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

CalculateOnBarClose = true; but its not?

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

    CalculateOnBarClose = true; but its not?

    I have CalculateOnBarClose set to true in my strategy. My strategy calls a custom indicator

    if (LucyFiler(0).Plot0[0] == 3)
    {
    ExitShort(
    "Bail", "Entry1");
    ExitShort(
    "Bail", "Entry2");
    }

    Here is my boggle.... it appears to be launching LucyFiler as if my strategy's CalculateOnBarClose = false; I sware it's set to true. Do I need to set something in the indicator to true?

    Thank You
    Howie

    #2
    All indicators called from within a strategy will take the CalculateOnBarClose value from the strategy. Make sure that when you run the stratey, the strategy dialog "Calculate on bar close" parameter is really set to a value of true.
    RayNinjaTrader Customer Service

    Comment


      #3
      Thank you Ray, I think the real problem is I have a short rountine I want to use as a subroutine but i don't know how to declare it so i used an indicator. Is there a reference for declaring our own subroutines. i'm not the best of programmers.
      Thanks,
      Howie

      Comment


        #4
        Yes, check the Help Guide for "User defined methods"
        RayNinjaTrader Customer Service

        Comment


          #5
          Thanks Ray that did the trick.

          Is this correct?
          1. Each Strategy that calls an indicator has its own set of data from that indicator (a separate instance)?

          2. Would the same be true of user defined methods? in other words there are separate instances for each strategy that calls the user defined method?
          My method holds a counter for each time called and i want to make sure there will be separate instances for each strategy that calls the method since the count is related to each separate instrument. I have the same strategy running on several different instruments.

          THANKS AGAIN!
          Howie

          Comment


            #6
            1) yes
            2) yes

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by egordleo, Today, 05:50 AM
            0 responses
            3 views
            0 likes
            Last Post egordleo  
            Started by kevinenergy, 02-17-2023, 12:42 PM
            118 responses
            2,778 views
            1 like
            Last Post kevinenergy  
            Started by briansaul, Today, 05:31 AM
            0 responses
            9 views
            0 likes
            Last Post briansaul  
            Started by fwendolynlpxz, Today, 05:19 AM
            0 responses
            4 views
            0 likes
            Last Post fwendolynlpxz  
            Started by traderqz, Yesterday, 12:06 AM
            11 responses
            28 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X