Hello again after a long time.
I found this old code here. See above.
I wanted to ask how I can set the stop below the outside candle and the take profit to the next higher high?
Can anyone help please?
There you go:
ONCE Tally = 0
OTD = (Barindex - TradeIndex(1) > IntradayBarIndex)
OutSideBAR = (high > high[1]) AND (low < low[1])
IF OutSideBAR AND Not OnMarket THEN
Tally = 1
Entry = high + 5 * PipSize //Entry price = HIGH + 5 pips
SL = low - 1*PipSize
TP = high + 1*PipSize
ENDIF
IF Tally > 5 OR OnMarket OR (StrategyProfit <> StrategyProfit[1]) THEN
Tally = 0
ELSIF Tally[1] > 0 THEN
Tally = Tally + 1
ENDIF
MaxShares = abs(COUNTOFPOSITION) <= 1
IF Tally AND Not LongOnMarket AND MaxShares AND OTD THEN
BUY 1 CONTRACT AT Entry STOP
SET STOP PRICE SL
SET TARGET PRICE TP
ENDIF
//graph Tally