Hi,
Question: is it possible to set a Trailing Stop based on time?
The situation is as follows:
Buy 1 LOT AT MARKET with a trailing stop of 10 points (from the entry price) in a 15 min chart.
After buying 1 LOT, the price drops and the trailing stop stays at 10 points and after 5 min. the price is still below the entry price.
Is it possible that after 5 min. , the trailing stop moves automatically to 5 points (from the entry price) and after 10 min. to breakeven and so on….. so in steps of 5?
There you go (you should run it on a 5-minute, or 1-minute, chart):
Timeframe(default)
IF Not OnMarket THEN
MyEXIT = 10 * PipSize
LastPrice = 0
ENDIF
//
Timeframe(15 minute,UpdateOnClose)
IF close CROSSES OVER average[200,1](close) AND Not OnMarket THEN
BUY 1 CONTRACT AT MARKET
SET STOP LOSS MyEXIT
SET TARGET PROFIT MyEXIT * 3
ENDIF
//
Timeframe(default)
IF OnMarket THEN
IF Not OnMarket[1] THEN
MyEXIT = (TradePrice - MyEXIT)
LastPrice = TradePrice
ENDIF
IF close > (LastPrice + 5*PipSize) THEN
LastPrice = close
MyEXIT = MyEXIT + 5*PipSize
ENDIF
ENDIF
IF LongOnMarket THEN
SELL AT MyEXIT STOP
ENDIF
//graphonprice MyEXIT coloured(255,0,0,255)
//graphonprice TradePrice coloured(0,0,255,255)
//graphonprice LastPrice coloured(0,128,0,155)