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

Indicator OnBarClose from Strategy

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

    Indicator OnBarClose from Strategy

    Hi

    I have a strategy that calculates on each tick and tried to add a doji from code however it does not seem to work as my chart is now filled with doji found text. It works fine if I add it from the UI. Also if I change the strategy to OnBarClose I can add it find from code.

    any ideas?

    #2
    Hello,

    Thank you for the post.

    I wanted to check, when you add the indicator with the UI, are you setting it as calculate OnBarClose? Does it have the same problem if you manually set the indicator to calculate on each tick instead?

    If so, you would either need to have the strategy calculate on bar close, or re program the indicator to work the same On each tick. You could use properties like IsFirstTickOfBar to know when a bar has opened/closed as one example.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      the indicator works fine for both modes when i use the UI.

      Comment


        #4
        Hello,

        Thank you for confirming.

        In the case where it only does not work in one situation, you would likely need to debug that specific situation.

        I would likely suggest creating a more simple example of the strategy that calls the indicator to start with or even just a new script to test the indicator by its self.

        If you could do this and then provide the syntax on how the indicator is being used in the strategy it may provide some more detail as to what is happening.

        Outside of doing this, you would very likely need to add prints into the indicator and then check both the working and non-working situation to see what is being evaluated differently.

        We have a short guide with general debugging steps at the following link: http://ninjatrader.com/support/forum...49&postcount=2


        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jpapa, Today, 07:22 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by kevinenergy, 02-17-2023, 12:42 PM
        116 responses
        2,757 views
        1 like
        Last Post kevinenergy  
        Started by franatas, 12-04-2023, 03:43 AM
        7 responses
        106 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Jltarrau, Today, 05:57 AM
        3 responses
        8 views
        0 likes
        Last Post Jltarrau  
        Started by f.saeidi, Today, 05:56 AM
        2 responses
        8 views
        0 likes
        Last Post NinjaTrader_Erick  
        Working...
        X