How to code: RSI gt 55 for the last 10 bars ?
Results 1 to 2 of 2

Thread: How to code: RSI gt 55 for the last 10 bars ?

  1. #1
    If I wish to look at the tendency in the RSI to make sure that the RSI has been for the last 10 bars above 55 how would this be coded? I really don't want to compare the current bar shift = 0 to the bar shift = 10. I want the values to be greater than 55.

    I am pretty sure that is an Array function but not sure how to code it.

    Thanks

  2. #2
    Hi


    Try this code

    Inserted Code extern int RSIPeriod=14; extern int rsiline=55; datetime Time1; int start() if(Time1! =Time#91;0#93;-RRB- Time1=Time#91;0#93;; else return(0); bool OpenBuy=CheckRSIBUY(); should(OpenBuy) // write code to get openbuy here if rsi preceding rsiline for last 10 candles return(0); bool CheckRSIBUY() int R=0; dual Q; for(int I=1; ilt;=10; I ) Q=iRSI(NULL, 0, RSIPeriod, PRICE_CLOSE,I); should(Q gt; rsiline ) R ; Sleep(50); RefreshRates(); if(Rgt;=10)return(true); else return(false);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners more information