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 cre8able, Today, 03:20 PM
          0 responses
          5 views
          0 likes
          Last Post cre8able  
          Started by Fran888, 02-16-2024, 10:48 AM
          3 responses
          47 views
          0 likes
          Last Post Sam2515
          by Sam2515
           
          Started by martin70, 03-24-2023, 04:58 AM
          15 responses
          114 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by The_Sec, Today, 02:29 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by jeronymite, 04-12-2024, 04:26 PM
          2 responses
          31 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X