Added a filter to only enter trades when the RSI is greater than (or less than if shorting) the 26 period EMA of the RSI. Turned off stop losses for better gains.
Hi, thank you for your script. I'm knew to pine script.
Is there a way to put stop loss with fixed amount, like exit a trade if it goes 100 pips in opposite direction?
I tried strategy.exit("Buy", loss = close - 100), but it doesn't work. if I entered long at 9700 I want SL to be at 9600, is it possible?
Thank you
ikoskela
⋅
@whitesiroi, there is stop loss functionality built into this one. Look at the last lines:
if (UseStopLoss)
strategy.exit("StopLoss", "LongId", loss = close * stopLoss / 1000 / syminfo.mintick)
strategy.exit("StopLoss", "ShortId", loss = close * stopLoss / 1000 / syminfo.mintick)
try:
if (UseStopLoss)
strategy.exit("StopLoss", "LongId", loss = close -100)
I'm new to this too so let me know if that works
whitesiroi
⋅
@ikoskela, thank you for your reply.
still it doesn't close when I expect it to :)
gonna try different variations :)
Looks like I need to use "stop" instead of "loss" but still it doesn't work as expected:)
here is the working example I found tradingview.com/script/o5InDPbl-Open-Close-Cross-Strategy/
Thank you