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

The True Mean Value of a Bar

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

    The True Mean Value of a Bar

    Hi, I'm new to these posts hence excuse my ignorance if there is a quick and silly fix to the following; I use simple high low bars in some of my trading, I’m trying to plot the true mean of each bar plotted preferably as a small horizontal line at the mean price of each bar. I would then like to plot the horizontal line in green if price closes in the top 30% of the bars range, red if it closes in the bottom 30% of the bars range and orange if it closes between 30%-70% of the bars range. However I can not seem to get past step one which is getting a SMA to plot the mean of a single bar. For example if a bars range is 10-20 hence total range of 10 ticks the true mean should be at 15. I have set the simple MA indicator to plot the MA of 1 period hence I would expect a plot mid point at 15, however I do not get that result. It appears Ninja is defaulting to the close or last of the bar rather than the true mean. Is there a way of modifying this?

    #2
    Originally posted by FXBob View Post
    Hi, I'm new to these posts hence excuse my ignorance if there is a quick and silly fix to the following; I use simple high low bars in some of my trading, I’m trying to plot the true mean of each bar plotted preferably as a small horizontal line at the mean price of each bar. I would then like to plot the horizontal line in green if price closes in the top 30% of the bars range, red if it closes in the bottom 30% of the bars range and orange if it closes between 30%-70% of the bars range. However I can not seem to get past step one which is getting a SMA to plot the mean of a single bar. For example if a bars range is 10-20 hence total range of 10 ticks the true mean should be at 15. I have set the simple MA indicator to plot the MA of 1 period hence I would expect a plot mid point at 15, however I do not get that result. It appears Ninja is defaulting to the close or last of the bar rather than the true mean. Is there a way of modifying this?
    There is more than one way, but the simplest is to use the Median as the input price type. NT is using the "median" to mean (high+low)/2: it is correctly the mid-point.

    Comment


      #3
      Koganam thanks for the tip, shall try that, however where do I find the price input type? I've checked Data Series and also Properties? Under Data series I only see the option of Price based on Last, Bid or Ask? no mean or median, the other thing is I like to see the full range off the bar when looking at the data.

      Comment


        #4
        Bob, you would need to select to drive your SMA indicator on the Median series under 'Input Series' in the Indicator properties, the chart itself will either be driven on Last, Bid or Ask.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Bertrand, thanks that worked a treat, looks good now. Anyone got any idea's on how to plot the secondary requirement on the price chart; a horizontal line (at the mean price) in green if price closes in the top 30% of the bars range, red if it closes in the bottom 30% of the bars range and orange if it closes between 30%-70% of the bars range.

          Comment


            #6
            Originally posted by FXBob View Post
            Bertrand, thanks that worked a treat, looks good now. Anyone got any idea's on how to plot the secondary requirement on the price chart; a horizontal line (at the mean price) in green if price closes in the top 30% of the bars range, red if it closes in the bottom 30% of the bars range and orange if it closes between 30%-70% of the bars range.
            You will have to write a custom indicator to do that.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ZenCortexCLICK, Today, 04:58 AM
            0 responses
            1 view
            0 likes
            Last Post ZenCortexCLICK  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            172 responses
            2,279 views
            0 likes
            Last Post sidlercom80  
            Started by Irukandji, Yesterday, 02:53 AM
            2 responses
            17 views
            0 likes
            Last Post Irukandji  
            Started by adeelshahzad, Today, 03:54 AM
            0 responses
            4 views
            0 likes
            Last Post adeelshahzad  
            Started by Barry Milan, Yesterday, 10:35 PM
            3 responses
            13 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X