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 techgetgame, Yesterday, 11:42 PM
            0 responses
            8 views
            0 likes
            Last Post techgetgame  
            Started by sephichapdson, Yesterday, 11:36 PM
            0 responses
            2 views
            0 likes
            Last Post sephichapdson  
            Started by bortz, 11-06-2023, 08:04 AM
            47 responses
            1,615 views
            0 likes
            Last Post aligator  
            Started by jaybedreamin, Yesterday, 05:56 PM
            0 responses
            10 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            20 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Working...
            X