I'm currently coding my first binary ea which is based on price simply crossing above the upper and lower line of the Bollinger Bands.
The problem I'm having is I want the order to executed as soon as the candle starts. So for example for a sell trade the previous candle cross the upper line and as soon as the next candle starts the order must be taken.
My current ea takes trade 30 seconds or more after the candle has opened.
Code for buy trade:
Code for a sell tradeAny advise or correction I can do to let the order executed on the start on the candle ?
When and where is this code executed ?
You have to detect a new bar and only execute this code when there is one. We don't see all the code so it's difficult to answer exactly (Cross() function ?).
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'm currently coding my first binary ea which is based on price simply crossing above the upper and lower line of the Bollinger Bands.
The problem I'm having is I want the order to executed as soon as the candle starts. So for example for a sell trade the previous candle cross the upper line and as soon as the next candle starts the order must be taken.
My current ea takes trade 30 seconds or more after the candle has opened.
Code for buy trade:
Code for a sell tradeAny advise or correction I can do to let the order executed on the start on the candle ?