Announcement

Collapse
No announcement yet.

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.

    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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        54 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        72 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X