RSI variable trigger
Forums › ProRealTime English forum › ProOrder support › RSI variable trigger
- This topic has 6 replies, 3 voices, and was last updated 3 years ago by
robertogozzi.
-
-
12/19/2021 at 4:47 PM #183602
I read this – I know it is just a simple scalping setup, but I am still earning and I wondered how would you code this?
For a buy entry, wait for the price to rise above the 200-EMA, where the RSI should fall below 40 (but not below 25). Wait for the RSI to go back above 40 and enter at the candle close corresponding to when the RSI crosses above 40. Make sure to set your stop-loss (SL) at the swing low created by the bullish price increase and set take-profit (TP) at two times the risk on the SL.
I don’t know enough on how you get it to monitor the RSI continously from the price rising above the 200-EMA – if this is at all possible?
Would you do a MYCONDITION to setup the 200-EMA cross?
Then set a trigger 1 for falling below 40 RSI? But then how do you write in that it shouldn’t fall below 25? and that it needs to go back above 40 before entering the trade?
Thanks
12/19/2021 at 9:39 PM #183607Simple Scalping12345678910111213DEFPARAM CumulateOrders = FalseIf Close Crosses Over ExponentialAverage[200](close) thenMyEMACond = 1ElsIf Close Crosses Under ExponentialAverage[200](close) thenMyEMACond = 0EndIfIf RSI[14](close) Crosses Over 40 and MyEMACond = 1 thenBuy 1 contract at MarketSET STOP pLOSS 10SET TARGET pPROFIT 20EndIfSomething like this:
Only your stop loss is now at the place where the price crosses the RSI above 40.
I think that when you set these conditions (RSI Crosses Over 40) that you can never find out the previous Swing Low.
12/20/2021 at 1:28 AM #183610Yes I got as far as you got, but then there is no way to programme in a series of triggers which it has to hit in sequence?
i.e hit target 1, then hit target 2, then hit target 3 when these 3 are hit in sequence trigger ..
12/20/2021 at 1:42 AM #18361112/20/2021 at 12:08 PM #183628Yeah but this is the problem isn’t it?
The 3rd criteria shall we call it – rather than a target is that it needs to fall below 40, but not below 25.
And that these criteria / targets need to happen in sequence otherwise the move is invalid, but I see you tackle this by adding the previous target to the next targets criteria?
So I guess it is how you get it to understand that it is a moving timeframe and not a specific moment in time.
12/20/2021 at 2:39 PM #183636The “RSI Crosses Over 40” guarantees that the RSI has been below 40 before that because it crosses from below 40 to above 40 (and the RSI is then of course also > 25).
Thus, no position is opened when the RSI < 40 or when the RSI < 25.
You can possibly set an extra condition that, for example, the RSI MUST first hit the 25, but I do not know if you want that.
In any case, it must be unambiguously fixed what needs to be done otherwise you cannot program it.
12/21/2021 at 7:19 AM #183665Try this one, it will spot any Ema200 crossover while Rsi < 40, then waits for an Rsi crossover (provided it did not fall below 25, in between):
1234567891011121314151617181920212223242526272829DEFPARAM CumulateOrders = FalseDEFPARAM PreLoadBars = 10000ONCE Trigger1 = 0ONCE Trigger2 = 0ONCE SL = 0ONCE TP = 0Ema200 = average[200,1](close)MyRSI = rsi[14](close)IF Trigger1 = 0 THENTrigger1 = (close CROSSES OVER Ema200) AND (MyRSI < 40)ENDIFIF Trigger2 = 0 AND Trigger1 = 1 THENTrigger2 = MyRSI CROSSES OVER 40ENDIFIF Not OnMarket AND Trigger2 THENBUY 1 CONTRACT AT MarketSL = abs(close - lowest[5](low))TP = SL * 2SET STOP LOSS SLSET TARGET PROFIT TPENDIFIF OnMarket OR (close <= Ema200) OR (MyRSI < 25) THENTrigger1 = 0Trigger2 = 0ENDIF//graph (close CROSSES OVER Ema200)// AND (MyRSI crosses over 40)//graph (close CROSSES OVER Ema200) AND (MyRSI < 40) coloured(255,0,0,255)//graph trigger1 coloured(0,128,0,155)//graph trigger2 coloured(0,0,255,255) -
AuthorPosts
Find exclusive trading pro-tools on