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 Sparkyboy, Today, 10:57 AM
        0 responses
        1 view
        0 likes
        Last Post Sparkyboy  
        Started by TheMarlin801, 10-13-2020, 01:40 AM
        21 responses
        3,916 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by timmbbo, 07-05-2023, 10:21 PM
        3 responses
        152 views
        0 likes
        Last Post grayfrog  
        Started by Lumbeezl, 01-11-2022, 06:50 PM
        30 responses
        809 views
        1 like
        Last Post grayfrog  
        Started by xiinteractive, 04-09-2024, 08:08 AM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_Erick  
        Working...
        X