Announcement

Collapse
No announcement yet.

LRS indicator w/RSI

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • LRS indicator w/RSI

    How can I change the Linear Regression Slope indy to use RSIstudy instead of MAstudy

  • #2
    dianeparson
    FWIW the MA is used in that script only as a proxy for current price to simplify the selection of the Source. Note in fact that the length of the MA is hard coded to 1.
    Anyhow if you want to replace the MA with the RSI change lines 45 and 47

    PHP Code:
    if(xMA == nullxMA = new MAStudy(1,0,Source,MAStudy.SIMPLE);

    var 
    vValue xMA.getValue(MAStudy.MA); 
    to the following

    PHP Code:
    if(xMA == nullxMA = new RSIStudy(nnSource);

    var 
    vValue xMA.getValue(RSIStudy.RSI); 
    where nn in RSIStudy(nn, Source); is the length of the RSI.
    At this point the LRS will be using the RSI study as the input.
    Alex

    Comment

    Working...
    X