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

Changing Calculation Method

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

    Changing Calculation Method

    I coded an indicator starting with the wizard. After running it I saw that I wanted to change it from calculating on close to calculate on price change.

    So I simply changed it in the code as below, but it has not changed what is happening on the chart. Can you tell me why? and how do I fix it please?

    if (State == State.SetDefaults)
    {
    Calculate = Calculate.OnPriceChange;

    Cheers,
    Ken.

    #2
    Hello KennyK,

    By happening on the chart, what are you referring to and what are you looking to see vs expected?

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Reply

      Hi Alan,
      What I expect to see happening on the chart after changing the Calculation type from "OnBarClose" to "OnPriceChange", is the current bar should be the colour prescribed by my code same as the other bars, not the standard NT8 colour, only changing after the close of the bar.
      Cheers,
      Ken.

      Comment


        #4
        Hello KennyK,

        Would you please upload a copy of the code along with a screen shot, so I can test on my end?

        To export a NinjaScript from NinjaTrader 8 do the following:
        From the Control Center window select Tools -> Export -> NinjaScript...
        Click Add>Select the indicator>OK>Export.
        Then attach that file you saved; under My Docs>NT8>Bin>Custom>Select the downloaded .zip file.

        I look forward to your reply.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Got it sorted

          Hi Alan,
          I have it all sorted now. Silly me forgot that I set a default preset up for the indicator earlier while it was set to on bar close. So every time I put the indicator on a chart it would be set to that preset, despite the coding change. So I restored the default and all is good.
          Cheers,
          Ken.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by usazencort, Today, 01:16 AM
          0 responses
          1 view
          0 likes
          Last Post usazencort  
          Started by kaywai, 09-01-2023, 08:44 PM
          5 responses
          603 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by xiinteractive, 04-09-2024, 08:08 AM
          6 responses
          22 views
          0 likes
          Last Post xiinteractive  
          Started by Pattontje, Yesterday, 02:10 PM
          2 responses
          21 views
          0 likes
          Last Post Pattontje  
          Started by flybuzz, 04-21-2024, 04:07 PM
          17 responses
          230 views
          0 likes
          Last Post TradingLoss  
          Working...
          X