Hi fellow traders,
Recently I have developed an EA, but has a glitch where I can not fix it. So would any of you please help me find and fix the problem?
Quick intro: This EA is to Buy on a break above RSI level of 30, and is to Sell on a break below RSI level of 70 at the candle close. The issue is that, it opens the order on every tick and doesn't wait for the candle to close.
Below is the EA script:
You could add this to your opening conditions:
Volume[0]<=1
So effectively a trade can only be opened when a new bar shows up.
if(RSICurrent<RSIUpperLevel && RSIPrevious>RSIUpperLevel && Volume[0]<=1), the same for the other operation
Thanks. But after adding that command to my EA, it doesn't open any order. !!!
Thanks. But after adding that command to my EA, it doesn't open any order. !!!
oh yeah that means that the action happens inside the canlde , your EA looks very similar to the Macd Sample from mt4 , you should try to code it within the Moving Average sample , it has separate entry and exit with Open on candle open but that can be resolved . will try to send you an example ......
oh yeah that means that the action happens inside the canlde , your EA looks very similar to the Macd Sample from mt4 , you should try to code it within the Moving Average sample , it has separate entry and exit with Open on candle open but that can be resolved . will try to send you an example ......
Yes. I modified MACD sample to create my EA.
I appreciate your kind help Catalin.
Yes. I modified MACD sample to create my EA.
I appreciate your kind help Catalin.
it works now , fine results , though stoploss is very large , in the long term it will be on break-even
simple way
if(Volume[0]<=1) ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point,"My sample",16384,0,Green);
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi fellow traders,
Recently I have developed an EA, but has a glitch where I can not fix it. So would any of you please help me find and fix the problem?
Quick intro: This EA is to Buy on a break above RSI level of 30, and is to Sell on a break below RSI level of 70 at the candle close. The issue is that, it opens the order on every tick and doesn't wait for the candle to close.
Below is the EA script: