[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 412
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
Colleagues, could you please answer the following question?
I open 4 buy orders by hand, I run an EA that deletes the set orders at Bid price, slippage is 100 pips, deletion in a loop, thread occupancy check and quote update are present. Why aren't all orders deleted in the loop? The log shows that the deletion takes a few initializations of the start() function
here is the EA log:
17:16:59 temp EURUSD,M1: loaded successfully
17:17:51 temp EURUSD,M1: New tick arrived
17:17:51 temp EURUSD,M1: Total orders = 4
17:17:51 temp EURUSD,M1: delete order = 0 tick order = 2808657
17:17:52 temp EURUSD,M1: close #2808657 buy 1.00 EURUSD at 1.28969 at price 1.28973
17:17:52 temp EURUSD,M1: error=0
17:17:52 temp EURUSD,M1: remove order = 1 ticket order = 2808659
17:17:52 temp EURUSD,M1: close #2808659 buy 1.00 EURUSD at 1.28974 at price 1.28975
17:17:52 temp EURUSD,M1: Error=0
17:17:54 temp EURUSD,M1: New tick came
17:17:54 temp EURUSD,M1: Total orders = 2
17:17:54 temp EURUSD,M1: remove order = 0 tick order = 2808658
17:17:54 temp EURUSD,M1: close #2808658 buy 1.00 EURUSD at 1.28969 at price 1.28976
17:17:54 temp EURUSD,M1: Error=0
17:17:56 temp EURUSD,M1: New tick came
17:17:56 temp EURUSD,M1: Total orders = 1
17:17:56 temp EURUSD,M1: remove order = 0 tick order = 2808660
17:17:56 temp EURUSD,M1: close #2808660 buy 1.00 EURUSD at 1.28976 at price 1.28977
17:17:56 temp EURUSD,M1: error=0
Unfold the loop :
Unfold the loop :
Thank you, it works. And what is the reason for this logic? I understand that something happens with numbering of orders after they have been opened and deleted, but I still don't understand exactly what it is.
You have four orders.
The cycle has started.
i = 0. Select a zero order. We delete zero orders, leaving 3 orders.
Check. Now there are 3 orders, i = 0 < 3. Go to the second cycle
i = 1. Select the first order. Delete the first order, and there are 2 orders left.
Check. Now there are 2 orders, i = 1 < 2. Go to the third loop
i = 2. We select the second order. And we have only 2 (that is, the de facto third order out of the two). OrderSelect will return false
i = 3. Select the third order. And we have only 2 (i.e. de facto the fourth order of two). OrderSelect will return false
You have four orders.
The cycle has started.
i = 0. Select a zero order. We delete zero orders, leaving 3 orders.
Check. Now there are 3 orders, i = 0 < 3. Go to the second cycle
i = 1. Select the first order. Delete the first order, and there are 2 orders left.
Check. Now there are 2 orders, i = 1 < 2. Go to the third loop
i = 2. We select the second order. And we have only 2 (that is, the de facto third order out of the two). OrderSelect will return false
i = 3. Select the third order. And we have only 2 (i.e. de facto the fourth order of two). OrderSelect will return false
Can you tell me the simplest Expert Advisor SMA (SMA line crossing the price) so I need it to open only on the closure of the candle at the crossover.
And why should it open orders, especially if the story is blank. I don't like editing other people's posts.
I'm a newbie, I can't get it all at once . I'll correct myself! If there are no orders OrdersHistoryTotal()==0the condition to open, I prescribed it! Or am I mixing something up!? I'm not asking to edit the code, point out the error or give directions so I can figure it out ...! if you don't mind ...thanks!
If there are no orders in the history, a new order will never be opened. I replied back the first time
Is there a limit to the number of parameters in a non-standard indicator, when connected via iCustom?
I have an indicator with about 8 parameters, I entered all the parameters correctly, I checked it several times, but at compilation error ')' still appears - wrong parameters count D:\InstaTrader\experts\Expert_2.mq4 (11, 280)