If suppose you want to use an interval of 5 bars before you can reverse an order then you could have this at the beginning
(am assuming your code is running on new bar because you're using iTime)
extern int _interval=5; //global variable static int _counter; if (AccountBalance()>= AccountLossRecord) { _counter=0; } if (AccountBalance()< AccountLossRecord) { _counter++; } if(_counter<_interval) { return; }
ssn:
If suppose you want to use an interval of 5 bars before you can reverse an order then you could have this at the beginning
(am assuming your code is running on new bar because you're using iTime)
Just solve my own problem over night after cracking some brains.
Use a counter to Activate GoGoReverse. Then GoGoReverse will On Off the ReverseStart Button.
if(AccountBalance()< AccountLossRecord && TimeStamp!=iTime(NULL,0,0)){ CounterRervs=CounterRervs+1; TimeStamp=iTime(NULL,0,0); AccountLossRecord=AccountBalance();} if (CounterRervs >=LossTimes) {GoGoReverse=True; CounterRervs=0; } if(AutoReverse==True && ReverseStart==False ){ if (GoGoReverse==True ) ReverseStart=True; GoGoReverse=False; } if(AutoReverse==True && ReverseStart==True ) {if (GoGoReverse==True ) ReverseStart=False; GoGoReverse=False; } if( AccountBalance()> AccountLossRecord) AccountLossRecord=AccountBalance();

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Already figure out how to code the Auto Reverse Signal.
But can not figure how to add delay code for Having 2 times of Account Loss before change signal.
The center code able to Switch ON OFF Reverse when AccountBalance() less.
How to Code a counter to having xN times of AccountBalance() less (FrequencyDelay) before AutoReverse Start.