Coding Question on the TRO_RAT_ZONE Indicator

everything that doesn't belong elsewhere cometh here

Moderator: moderators

User avatar
Techguy
rank: <50 posts
rank: <50 posts
Posts: 17
Joined: Tue Nov 25, 2008 12:45 am
Reputation: 6
Location: Washington State
Real name: Denton Hess
Gender: None specified
Contact:

Coding Question on the TRO_RAT_ZONE Indicator

Postby Techguy » Fri Mar 29, 2019 2:34 pm

TRO: this is your modified TRO_RAT_ZONE indicator...
(or anyone else that knows the answer...)

I noted that the deinit() function got called in the init() function.
Am I missing something here? or is this a typo? Is there some diabolical bug, or advantage in MT4 that requires deinit() to be called in the init() function? See the line just before the return value.

I hadn't seen this before...

Thanks

Code: Select all

//+------------------------------------------------------------------+
int init()
  {
//---- indicators

   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,myWingDing);
   SetIndexBuffer(0,DynR);
   SetIndexEmptyValue(0,0.0);
   
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,myWingDing);
   SetIndexBuffer(1,DynS);
   SetIndexEmptyValue(1,0.0);
   
   SetIndexStyle(2,DRAW_ARROW);
   SetIndexArrow(2,myWingDing);
   SetIndexBuffer(2,LgTrig);
   SetIndexEmptyValue(2,0.0);
   
   SetIndexStyle(3,DRAW_ARROW);
   SetIndexArrow(3,myWingDing);
   SetIndexBuffer(3,ShTrig);
   SetIndexEmptyValue(3,0.0);
 
   SetIndexStyle(4,DRAW_ARROW);
   SetIndexArrow(4,myWingDing);
   SetIndexBuffer(4,BOTarget);
   SetIndexEmptyValue(4,0.0);
     
   
   period       = Period(); 
   tChartPeriod =  TimeFrameToString(period) ;
   symbol       =  Symbol() ;   
   digits       =  Digits ;   
   Trigger      =  Time[0] ; 
   point        =  Point ;
   
   if(digits == 5 || digits == 3) { digits = digits - 1 ; point = point * 10 ; } 

   xThreshold  = iThreshold * point ;

   PipsTrigger = iPipsTrigger * point ;
   
   ShortName    =  TAG+symbol+iPeriods ;


if( myCorner == 0 || myCorner == 2 )

   x001 = 0 ;
   x002 = 0 ;
   x003 = 90 ;
   x004 = 150;
   x005 = 100 ;
   x006 = 10 ; 
   x007 = 0 ;
   FillAmt = 20 ;     
}
else
{
   x001 = 0 ;
   x002 = 10 ; // 
   x003 = 60 ;  // val 
   x004 = 0 ; //  dif
   x005 = 0 ;
   x006 = 10 ; 
   x007 = 220 ;  // arrow
   FillAmt = 23 ;
}

   BreakOutPips = iBreakOutPips * point ;
     
   deinit() ;
 
   return(0);
  }


Thanks

ooops TRO Rat Zone not sweetspot.
"Everything can be taken from a man but one thing: the last of human freedoms - to choose one's attitude in any given set of circumstances, to choose one's own way." Viktor Frankl

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 13972
Joined: Sun May 14, 2006 9:31 pm
Reputation: 2246
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Re: Coding Question on the TRO_RAT_ZONE Indicator

Postby TheRumpledOne » Fri Mar 29, 2019 5:35 pm

Techguy wrote:TRO: this is your modified TRO_RAT_ZONE indicator...
(or anyone else that knows the answer...)

I noted that the deinit() function got called in the init() function.
Am I missing something here? or is this a typo? Is there some diabolical bug, or advantage in MT4 that requires deinit() to be called in the init() function? See the line just before the return value.


I do that to make sure everything starts "fresh". For example, deleting objects on the screen.
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!

Please do NOT PM me with trading or coding questions, post them in a thread.

User avatar
Techguy
rank: <50 posts
rank: <50 posts
Posts: 17
Joined: Tue Nov 25, 2008 12:45 am
Reputation: 6
Location: Washington State
Real name: Denton Hess
Gender: None specified
Contact:

Re: Coding Question on the TRO_RAT_ZONE Indicator

Postby Techguy » Sat Mar 30, 2019 7:10 pm

[/quote] I do that to make sure everything starts "fresh". For example, deleting objects on the screen.[/quote]

OK, I think I get it.

Thanks!
"Everything can be taken from a man but one thing: the last of human freedoms - to choose one's attitude in any given set of circumstances, to choose one's own way." Viktor Frankl

alvinnash
rank: <50 posts
rank: <50 posts
Posts: 1
Joined: Mon Jan 06, 2020 7:42 am
Reputation: 0
Gender: None specified

Re: Coding Question on the TRO_RAT_ZONE Indicator

Postby alvinnash » Mon Jan 06, 2020 8:01 am

Thank you!

niketsurve
rank: <50 posts
rank: <50 posts
Posts: 1
Joined: Thu Jan 09, 2020 5:03 am
Reputation: 0
Gender: None specified

Re: Coding Question on the TRO_RAT_ZONE Indicator

Postby niketsurve » Thu Jan 09, 2020 5:06 am

Good information.

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “general”