count_position() incompatible with multiple charts or multiple EAs/manual trading.
Beyond that add your print statements and find out why.
tsedawa:
Dears friends,
i have checked the following EA both on demo and live. In demo it works fine. But in live account it opens over 30 pending orders at one go at the same price and time and they all get executed when the price is reached. i have tried every possible settings from the input parameters. it did not work. please help me find out where the error is in the code. thanks in advance
i have to edit my problem, sorry. i mean strategy tester not demo.
tsedawa:
i have to edit my problem, sorry. i mean strategy tester not demo.
i have to edit my problem, sorry. i mean strategy tester not demo.
Why break ? why not continue ?
//-------- void count_position() { POS_n_BUY = 0; POS_n_SELL = 0; POS_n_BUYSTOP = 0; POS_n_SELLSTOP = 0; for( int i = 0 ; i < OrdersTotal() ; i++ ){ if( OrderSelect( i, SELECT_BY_POS, MODE_TRADES ) == false || OrderMagicNumber() != magic){ break; // why ? }
RaptorUK:
Why break ? why not continue ?
thankyou RaptorUk. i will try that.
RaptorUK:
Why break ? why not continue ?
i have no idea! but i will try continue instead of break, thank you Raptor.
RaptorUK:
Why break ? why not continue ?
so far it looks like u r right! i tried continue and it worked fine. then i changed back to break and it started opening many buystops. then again i changed back to continue and its behaving nicely. thanks a lot RaptorUK, u saved me.
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
Dears friends,
i have checked the following EA both on demo and live. In demo it works fine. But in live account it opens over 30 pending orders at one go at the same price and time and they all get executed when the price is reached. i have tried every possible settings from the input parameters. it did not work. please help me find out where the error is in the code. thanks in advance