Below attached file gives the user the option to have trades being opened from a horizontal line(invisible pending order), among with a specified SL and TP in pips. While it is working correctly, i have the idea of making it black swan proof.
During black swans normal (hard) pending (stop and limit) orders will most of the times be filled at the worst price possible, after huge slippage or a gap took place that is. Now the normal " slippage" function within alot of EA's/scripts (including attached one) will not work on ECN brokers because they follow different rules than market makers.
The idea: is it possible to add a function to a hidden pending order script, that has some kind of "wait before execution" rule implemented? What i mean by this is that whenever price reached the virtual horizontal pending order line, it will wait "x" amount of seconds, and then checks if price is "x" amount of pips in negative territory. If this condition is met, the script/ea will not turn the pending order line in an actuall market order.
Example: pending order buy limit at eur/usd 1.12000, price reaches 1.12000 and the timer goes counting up to "3 seconds(in this case)", after 3 seconds price is 10 pips below at 1.11990; the pending order line will not be an active market order.
Pending order buy limit at eur/usd 1.12000, price reaches 1.12000 and the timer goes counting up to "3 seconds(in this case)", after 3 seconds price is only 3 pips below at 1.11997; the pending order line will now open an active market order at 1.11997.
I left out bid and ask price in the above because that does not have a priority... for now
Unfortunately i do not have the MQ4 of the attached file... More detailed information about conditions, from its website:
During black swans normal (hard) pending (stop and limit) orders will most of the times be filled at the worst price possible, after huge slippage or a gap took place that is. Now the normal " slippage" function within alot of EA's/scripts (including attached one) will not work on ECN brokers because they follow different rules than market makers.
The idea: is it possible to add a function to a hidden pending order script, that has some kind of "wait before execution" rule implemented? What i mean by this is that whenever price reached the virtual horizontal pending order line, it will wait "x" amount of seconds, and then checks if price is "x" amount of pips in negative territory. If this condition is met, the script/ea will not turn the pending order line in an actuall market order.
Example: pending order buy limit at eur/usd 1.12000, price reaches 1.12000 and the timer goes counting up to "3 seconds(in this case)", after 3 seconds price is 10 pips below at 1.11990; the pending order line will not be an active market order.
Pending order buy limit at eur/usd 1.12000, price reaches 1.12000 and the timer goes counting up to "3 seconds(in this case)", after 3 seconds price is only 3 pips below at 1.11997; the pending order line will now open an active market order at 1.11997.
I left out bid and ask price in the above because that does not have a priority... for now
Unfortunately i do not have the MQ4 of the attached file... More detailed information about conditions, from its website:
QuoteDislikedScript HiddenPendingOrder
QuoteDislikedThe description of actions:
The script to open an order when price reach the specified value. Should be attached to the chart of currency pair at that will be opened order.
Assignment:
The script allows to automate trade. It is useful to those, who uses pending orders, but don't want that broker know an open-price of order. Start a script, set parameters of the order and you should not watch price any more.
Parameters:
The following a six parameters define the opened order.
Order_BuyDirection = type of the order; value true - buy, value false - sell.
Order_OpenPrice = the open price of the pending order.
Order_StopLoss = the level stop-loss of the order (in pips). If this parameter is equal 0 then position will opened without a level stop-loss.
Order_TakeProfit = the level take-profit of the order (in pips). If this parameter is equal 0 then position will opened without a level take-profit.
Order_Lots = the size of lots for order.
Order_Expiration = date of the expiration for pending order (time of broker).
Slippage = slippage (in pips).
MagicNumber = magic number for order.
ArrowColor = color for arrow on chart at open price of order.
PlaySoundAtOpen = enable/disable play sound file at open order.
PlaySoundAtOpen_FileName = the name of sound file that will played at open order. This parameter is used only if parameter PlaySoundAtOpen = true.
HiddenLevels = enable/disable hidden levels s/l and t/p.
ShowLineAtOpenPrice = enable/disable drawing horizontal line at open-price of order. Then you can modify open-price of order if move line by mouse.
ShowLineAtOpenPrice_Color = color for horizontal line that show an open-price of order. This parameter is used only if parameter ShowLineAtOpenPrice = true.
Delay = frequency of a check up current time. It is set in milliseconds, for example value 5000 means periodicity of 5 seconds. It is necessary to remember, that too often periodicity can brake the terminal.
Attached File(s)
HiddenPendingOrder.ex4
45 KB
|
497 downloads