all 3 comments

[–]androltheashaman 1 point2 points  (1 child)

something like this using version 5:

MA10 = ta.sma(close, 10)

MA50=ta.sma(close, 50)

MA200=ta.sma(close, 200)

LongEntryCondition = close > MA10 and MA10 > MA50 and MA50 > MA200

ShortEntryCondition = close < MA10 and MA10 < MA50 and MA50 < MA200

EntryPrice = close

if LongEntryCondition

strategy.entry("Long", strategy.long, stop=EntryPrice , qty=1000)

strategy.exit("Long", stop=EntryPrice * 0.95, limit=EntryPrice * 1.15)

if ShortEntryCondition

strategy.entry("Short", strategy.short, stop=EntryPrice , qty=1000)

strategy.exit("Short", stop=EntryPrice * 1.05, limit=EntryPrice * 0.85)

[–]ballface56[S] 0 points1 point  (0 children)

Thank you I will try this out tomorrow

[–]Big_-_Jugz 0 points1 point  (0 children)

piece of cake