- [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.
- i need EA for open pending order
- Automatically converting pending orders after an open order has closed
hi guys im creating an EA that will place a pending order at a specific time,for example lets say i decide that at 3:30 pm i decide that my EA places a pending buy order,however what tends to happen and is the obstacle right now is that,at 3:30 the EA makes the pending order just as instructed,but after this order has been closed it continues to make more orders,for as long as the time is still 3:30 on the clock,which means it only stops making these orders after 3:30 whic is 3:31,this is not what i want thouh,i want the EA to only make one oder and nothing more at 3:30.If any one can help guys how can i do this?
Fix your code
-
There is no need to create pending orders in code.
- The pending has the slight advantage, A) you are closer to the top of the queue (filled quicker), B) there's no round trip network delay (filled quicker.)
- Don't worry about it unless you're scalping M1 or trading news.
- Humans can't watch the screen 24/7, so they use pending orders; EAs can, so no need for pending orders, have it wait until the market reaches the trigger price and just open an order.
- Princy333: i want the EA to only make one oder and nothing more at 3:30.If any one can help guys how can i do this?
Place a new bar test inside your 3:30 test so it tries only once.
For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
MT4: New candle - MQL4 programming forum #3 (2014)
MT5: Accessing variables - MQL4 programming forum #3 (2022)I disagree with making a new bar function, because it can only be called once per tick (second call returns false). A variable can be tested multiple times.
Running EA once at the start of each bar - MQL4 programming forum (2011)
-
There is no need to create pending orders in code.
- The pending has the slight advantage, A) you are closer to the top of the queue (filled quicker), B) there's no round trip network delay (filled quicker.)
- Don't worry about it unless you're scalping M1 or trading news.
- Humans can't watch the screen 24/7, so they use pending orders; EAs can, so no need for pending orders, have it wait until the market reaches the trigger price and just open an order.
-
Place a new bar test inside your 3:30 test so it tries only once.
For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
MT4: New candle - MQL4 programming forum #3 (2014)
MT5: Accessing variables - MQL4 programming forum #3 (2022)I disagree with making a new bar function, because it can only be called once per tick (second call returns false). A variable can be tested multiple times.
Running EA once at the start of each bar - MQL4 programming forum (2011)
Hi William,i actually thought about the new bar class and im thinking perhaps it could work, but wait im a bit confused by your response,first you say i should create the new bar test,but then again you say bars are unreliable,then u say u are against creating a new bar function because it can only be called once per tick(But isnt that what im looking for?the EA to only execute a single trade)and another thing i would like you to clarify,if you say bars are unreliable,but then again you said i must always use time so again im not sure if you sayin i should place the new bar test as you recommend or not place it and just rely on time?
-
There is no need to create pending orders in code.
- The pending has the slight advantage, A) you are closer to the top of the queue (filled quicker), B) there's no round trip network delay (filled quicker.)
- Don't worry about it unless you're scalping M1 or trading news.
- Humans can't watch the screen 24/7, so they use pending orders; EAs can, so no need for pending orders, have it wait until the market reaches the trigger price and just open an order.
-
Place a new bar test inside your 3:30 test so it tries only once.
For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
MT4: New candle - MQL4 programming forum #3 (2014)
MT5: Accessing variables - MQL4 programming forum #3 (2022)I disagree with making a new bar function, because it can only be called once per tick (second call returns false). A variable can be tested multiple times.
Running EA once at the start of each bar - MQL4 programming forum (2011)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use