How to build a generic indicator?

Forums ProRealTime English forum ProBuilder support How to build a generic indicator?

Viewing 6 posts - 1 through 6 (of 6 total)
  • #49640

    How can I make an indicator that can be applied to the price rather than to other indicators? For example, if I realize a Moving Average indicator and want it to be applied to other indicators or to the price, as is the case in the Prorealtime series indicators, at what should I refer in to the instructions?

    Thank’s

    Piero

    #49644

    1 – you started asking how to make an indicator to be applied to the price rather than to other indicators, all indicators are applied to the price, Moving Averages, Macd…..

    2 – you said “For example, if I realize a Moving Average indicator and want it to be applied to other indicators”, is the contrary of what you asked before; do you want an indicator applied to price (like all, normally, do) or to other indicators? In this latter case you may write

    as an example of a very stupid indicator just to explain basic building syntax; it’s a Moving Average, applied to another indicator (MACD in this case). You can make almost all you want.

    Unless what you wanted to ask is how to apply an indicator to the price chart, instead of the indicators area below it. In this case you can see the four attached pics:

    1 – click on the price Wrench icon (next to price tab) in the upper left corner of your chart

    2 – when the property box opens, select Price and then click on Add an Indicator, then choose one that can be applied to price

    3 – you will see the price of the chosen indicator in the property box

    4 – there you go (this example is an indicator in this forum to print candlestick labels on the price chart)

    If all the above is NOT what you asked for… ask again, with more details please.

    Roberto

    #49649

    I’m realizing an indicator that can be applied on others indicator and on the price if I want this too.

    I’m not using the indicators coded in PRT, like Average for example.

    If I use Average[5](Macd[12,26,9](close)) for example, the indicator use exclusively MACD data output to calculate the Average.

    So is not possible to use the same indicator programmed from me on others indicators than the MACD without changing the code.

    I hope to have been clear..

    Thank’s

     

    #49661

    I understand, it can be done, but it’s not as straightforward as if PRT language had arrays and pointers, example:

    you must set variables Selection, Periods,  m1, m2, m3, RsiNum and AvgType as modifiable by the user, so that you can assign them different values when CALLing the indicator.

    For the range of values to be assigned to AvgType, see https://www.prorealcode.com/documentation/average/.

    Of course you may add as many indicators as you want, but be aware that CALLing external indicators is a slow process, the slower the more complex it is!

    You want to call it this way:

    parameters must be written in the same order as you wrote your variables in the variable box (see pic).

    3 users thanked author for this post.
    #49669

    @robertogozzi

    You are my hero. Thanks a lot for all your detailed answers! 😀

    #49671

    ok, I understand. Thank’s

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

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