buy order at market when spread drop down to ZERO. currently is executed once on the chart, but without an open trade; since it's only about 2% chance spread would be at my target of ZERO.
how can I loop this script so that the script would execute a - How to execute a script only once?
- How can I have a pending order execute at an exact price without the spread difference?
- Scripts: XIT_BuySellAutoStoploss.mq4 - Stoploss set from Fractal Levels, Money management Risk/Reward
double spread = MarketInfo( Symbol(), MODE_SPREAD ); if ( spread == 0 ) { //order placement code here }
As for looping the script, why not use an EA? If you just want it to place an order when the condition is met and then be removed, you could do something like:
while ( spread > 0 ) { //... } //order placement code here

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