Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Add MidPoint- to Prior Day OHLC

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

    Add MidPoint- to Prior Day OHLC

    I am using the built in NT Indicator: PriorDayOHLC and need to add the 50%/midpoint level/line between yesterday's high and low. I also need it to be able to be styled as to color and size like the other lines.

    Any Ideas for a newbie???

    Thanks,
    DB

    #2
    Hello DB,

    If you want to make a new indicator and call the values of the prior high and low, you can call the indicator with PriorDayOHLC().PriorHigh[0].

    If you are wanting to modify the PriorDayOHLC, start by making a copy of the indicator so that you may modify the copy.

    Please use the steps I have provided below to create a copy of an indicator:
    • In the Control Center select Tools > Edit NinjaScript > Indicator...
    • Select the indicator to copy > Click Ok
    • Right-click within the code window > select Save As
    • Give the indicator a unique name > Click OK

    The PriorHigh and PriorLow are the plots that contain yesterday's high and low values.

    After the logic in the script that sets these values, you can use these how you would like.
    For example:
    Print(PriorHigh[0] - PriorLow[0]);
    This would print the different from yesterdays high to yesterdays low.

    You could set this in a plot similar to the plots that exist.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Are you saying that the following code would calculate the 50% value of yesterday's high and low?

      Print(PriorHigh[0] - PriorLow[0]);

      In other words, if the low of yesterday was 100 and the high was 200, that line of code would have a value of 150??? Or does the [0] vslue need to be changed somehow?

      Thanks

      Comment


        #4
        Hello DB,

        No, I am not specifying the math you will need for you calculations as this is outside of what is supported by NinjaTrader Support.

        I am demonstrating how to call the high and low values so that you may use these for your calculations.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pechtri, 06-22-2023, 02:31 AM
        9 responses
        122 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by frankthearm, 04-18-2024, 09:08 AM
        16 responses
        66 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by habeebft, Today, 01:18 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by benmarkal, Today, 12:52 PM
        2 responses
        14 views
        0 likes
        Last Post benmarkal  
        Started by f.saeidi, Today, 01:38 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X