Hello, my attached EA once executed, it will buy and then trailling stop previous 1 bar low and at same time, it will set pending order sell stop, but i backtest, it only open Buy order, and other function not work, could anyone check for me? TQVM
lot: number of lot to be executed
iTicket: put in the ticket number of the trade you want to monitor (first column in MT4 terminal)
iTmfrm: timeframe of which EA should trail by bars (e.g. 60 for H1)
iBars_n: number of bars for which the SL should be calculated (e.g. 2 means high/low of the last 2 bars, I use 1 for the previous bar)
iIndent: buffer in pips for SL (e.g. 10 means the SL will be placed 1 pip -for 5 digit broker- below/above the high/low of the last candle)
bTrlinloss: TRUE = SL will be moved even in loss (I use this) or FALSE = SL will only be moved if new SL is in profit
lot: number of lot to be executed
iTicket: put in the ticket number of the trade you want to monitor (first column in MT4 terminal)
iTmfrm: timeframe of which EA should trail by bars (e.g. 60 for H1)
iBars_n: number of bars for which the SL should be calculated (e.g. 2 means high/low of the last 2 bars, I use 1 for the previous bar)
iIndent: buffer in pips for SL (e.g. 10 means the SL will be placed 1 pip -for 5 digit broker- below/above the high/low of the last candle)
bTrlinloss: TRUE = SL will be moved even in loss (I use this) or FALSE = SL will only be moved if new SL is in profit
Attached File(s)
TrailingByShadows.mq4
13 KB
|
502 downloads