Igor Polushkin:
Hello Guys,
I am currently struggling with a function, that has to introduce pause into my trading system. The idea is pretty simple, if the rsx value is above 90, ea has to stop trading for a defined number of bars. Here is a part of my script. What am I doing wrong? Is there is simple solution for the problem?
Hello,
You could delay it by checking another bar than the 2 lasts with your rsi :
if(OrderSell<1 && SellSignal==1 && rsx[10]<rsx[11]) <--- will check for a signal at the 10th and 11th bar, rather than the two last (0&1) it's an example
Edit :
if (rsx[0] < CritBuyLevel && rsx[0] > CritSellLevel) { SignalTime=TimeCurrent(); Print("starting to wait"); }
This will never happen also ... you won't have the last rsx superior to critselllevel & inferior to critbuylevel simultaneously.
if (rsx[0] < CritBuyLevel || rsx[0] > CritSellLevel) { SignalTime=TimeCurrent(); Print("starting to wait"); }Try it so
Igor Polushkin: What am I doing wrong? Is there is simple solution for the problem?
if (tradeEnabled == true &&newBar == true && iBarShift(NULL,0, SignalTime) > WaitXBars)
Is SignalTime a global or static variable?
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
Hello Guys,
I am currently struggling with a function, that has to introduce pause into my trading system. The idea is pretty simple, if the rsx value is above 90, ea has to stop trading for a defined number of bars. Here is a part of my script. What am I doing wrong? Is there is simple solution for the problem?