Try sleeping it each cycle Sleep(100); for fastest solution.
Otherwise GetLastError() will tell you what went wrong.
- GetLastError() will tell you what went wrong. Always log errors.
oo.ticket = OrderSend( Symbol(), op.code, size, now.open, Slippage.Pips*pips2points, NO_SL, NO_TP, order.comment, magic.number, NO_EXPIRATION, op.color); if (oo.ticket < 0){ Alert( "OrderSend(type=", op.code, " (", op.text, "), lots=", size, ", price=", PriceToStr(now.open), " (", DeltaToPips(now.open-Bid), "), SL=0, TP=0, '", order.comment, "', ...) failed: ", GetLastError() );
- Sending many orders that fast will return ERR_TOO_FREQUENT_REQUESTS. Adding a sleep would help. Some brokers have a maximum order count of 100.
- You MUST RefreshRates() between any two server calls or after sleep

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
Hi, I'm playing around with scripts, and I have the following -very useless- script (for testing). T
int start()return(0);
}
Obviously, this is supposed to create 200 orders. However, after about 10 orders, the script is exited. No errors or warnings, simply exited with the message "script: useless_script EURUSD,H1: removed
Anybody have an idea why this happens? The script is exited before the for-loop ends.
Thanks