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 StockTrader88, 03-06-2021, 08:58 AM
            45 responses
            3,991 views
            3 likes
            Last Post johntraderuser2  
            Started by TAJTrades, Today, 09:46 AM
            0 responses
            7 views
            0 likes
            Last Post TAJTrades  
            Started by rhyminkevin, Yesterday, 04:58 PM
            5 responses
            62 views
            0 likes
            Last Post dp8282
            by dp8282
             
            Started by realblubb, Today, 09:28 AM
            0 responses
            8 views
            0 likes
            Last Post realblubb  
            Started by AaronKoRn, Yesterday, 09:49 PM
            1 response
            19 views
            0 likes
            Last Post Rikazkhan007  
            Working...
            X