how can I loop this script so that the script would execute a 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 to execute a script only once?
- [ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5.
- 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