RSI variable trigger

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #183602 quote
    idunnomuch
    Participant
    New

    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

    #183607 quote
    JS
    Participant
    Senior
    DEFPARAM CumulateOrders = False
    
    If Close Crosses Over ExponentialAverage[200](close) then
    MyEMACond = 1
    ElsIf Close Crosses Under ExponentialAverage[200](close) then
    MyEMACond = 0
    EndIf
    
    If RSI[14](close) Crosses Over 40 and MyEMACond = 1 then
    Buy 1 contract at Market
    SET STOP pLOSS 10
    SET TARGET pPROFIT 20
    EndIf

    Something 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.

    #183610 quote
    idunnomuch
    Participant
    New

    Yes 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 ..

    #183611 quote
    JS
    Participant
    Senior

    Target 1 =Close Crosses Over ExponentialAverage[200](close)

    Target 2 =RSI[14](close) Crosses Over 40 + Target 1

    Can you tell me what Target 3 is? 🙂

    #183628 quote
    idunnomuch
    Participant
    New

    Yeah 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.

    #183636 quote
    JS
    Participant
    Senior

    The “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.

    #183665 quote
    robertogozzi
    Moderator
    Master

    Try 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):

    DEFPARAM CumulateOrders = False
    DEFPARAM PreLoadBars    = 10000
    ONCE Trigger1 = 0
    ONCE Trigger2 = 0
    ONCE SL       = 0
    ONCE TP       = 0
    Ema200 = average[200,1](close)
    MyRSI  = rsi[14](close)
    IF Trigger1 = 0 THEN
       Trigger1 = (close CROSSES OVER Ema200) AND (MyRSI < 40)
    ENDIF
    IF Trigger2 = 0 AND Trigger1 = 1 THEN
       Trigger2 = MyRSI CROSSES OVER 40
    ENDIF
    IF Not OnMarket AND Trigger2 THEN
       BUY 1 CONTRACT AT Market
       SL = abs(close - lowest[5](low))
       TP = SL * 2
       SET STOP   LOSS   SL
       SET TARGET PROFIT TP
    ENDIF
    IF OnMarket OR (close <= Ema200) OR (MyRSI < 25) THEN
       Trigger1 = 0
       Trigger2 = 0
    ENDIF
    //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)
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

RSI variable trigger


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
idunnomuch @idunnomuch Participant
Summary

This topic contains 6 replies,
has 3 voices, and was last updated by robertogozzi
4 years, 2 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/19/2021
Status: Active
Attachments: No files
Logo Logo
Loading...