Coding question

Viewing 10 posts - 1 through 10 (of 10 total)
  • #3360

    Hello. I have a question about how to modify a code from the library.
    I’ve seen the Renko box on price chart indicator. I would like to know how to modify indicators to make them calculated on the renko box and not on the price. In the Renko indicator, i’ve seen 2 information Top and Bottom of the box. Maybe the middle would be correct… well, the goal would be to have the indicator calculated just like if it was on renko chart.

    So, let’s take for example the “Stair Step” indicator How would you modify the code to make it calculated on renko box indicator ??
    Here is the code :

    //parameters :
    // Step = 0.0010 forex 10 pips, adapt to item you are trading
    // MAperiod = 20

    once ssMA = close
    MA = average[MAperiod](close)

    if(MA > ssMA + Step) THEN
    ssMA = MA
    ELSIF (MA < ssMA – Step) THEN
    ssMA = MA
    ELSE
    ssMA = ssMA
    ENDIF

    RETURN ssMA

    And here is the renko code :

    #3363

    Well, if i understand correctly, you would like to make the stairstep moving average calculated with something else than a classical candle close? And in your case, that would be the close of a renko box? (or my so called indicator..:) )

    #3364

    Yes ! Correct. To have the same result than on a renko chart… but on candlestick chart with your renko indicator.

    #3365

    First, you’ll have to adapt the renko indicator with a new variable that deal with what is the current close. Because indicators are often calculated on Close, my renko box indicator does not have one.

    Then, instead of having :

     

    You should make :

     

    But you have to merge the 2 indicators first. Let me know if it works like you want.

    #3368

    Thanks a lot for your answer.
    I let you see if it can work like i want and tell me if it is the case.
    Thanks again

    #3370

    sofitech stepMA renko

    Here is the full indicator code :

     

    #3372

    With the boxes, more visual :

    renko boxes MA

    Just change the last line of the indicator by this :

     

    #3373

    Just great. Thanks.

    #3376

    You are welcome. Just ask. 🙂

    #3769

    Hey Sofitech, does it work like you want?

Viewing 10 posts - 1 through 10 (of 10 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login