Coding a Momentum Indicator

Forums ProRealTime English forum ProBuilder support Coding a Momentum Indicator

Viewing 5 posts - 1 through 5 (of 5 total)
  • #93133

    I have created a simple program for a 4-bar momentum indicator but want it to look like the PRT momentum indicator (i.e. having it oscillate on either side of zero line with different colours). Can anyone tell me what I need to add into the program to achieve this?  Thanks. My coding so far is this:

     

     

    #93137

    Welcome to the forums.

    There are a few basic rules that you should try to follow when posting in the forums. You broke a couple of them with your first post.

    1. Post in the correct forum section. I have moved your topic from the ‘General Discussion’ to the indicator related ‘ProBuilder’ forum.
    2. When posting code use the ‘Insert PRT Code’ button to make it more readable for others. I have tidied up your code.

     

    To answer your question try this:

     

    1 user thanked author for this post.
    #93242

    Thank you so much for your coding help. Two things: (1) is there a way I can get the momentum line to be black; and (2) is there a way I can have the zero line label not show?

    #93248

    I may be a little confused by your request  now! I thought that you wanted the line to change colour from green to red but did you really mean that you wanted the infill colour to change? If so then this can sort of be achieved by hard coding but it is far easier and gives a much better results if you just add a colour zone via the indicator settings and then save these settings as default for the indicator so that every time you apply the indicator it is the same. Your original code should produce a black line.

    If you remove the zero bits of code and add a separate ‘Horizontal Line’ indicator via the indicator settings then you might get rid of the “0” label – not certain so you need to test.

     

    1 user thanked author for this post.
    #93301

    Thanks so much for your help. I had wanted colour to either side of the 1% line, but the line itself to be black (which I’ve now got). If the line is coloured, the numbers/words come up in the data box as coloured text which is much harder to read on the screen than black.

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

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