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

Forcing indicator inside of strategy to run COBC=true

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

    Forcing indicator inside of strategy to run COBC=true

    I have a strategy that is set to COBC=false. It's running two data series - the primary is 60-min and the secondary 1-min. The 0 series is used for candle triggers and the 1-min for historical executions.

    My indicator has a mode in which it slides through a sequence of states based on data thresholds. Apparently the live mode in combination with the strategy running COBC=false is producing erroneous internal states in the indicator which I find difficult to circumvent. Thus the easiest solution would be somehow force the indicator to run COBC=true.

    NT support tells me that is impossible thus I am opening this up to the forum to find out if anyone has found a way of hacking this. I was thinking that perhaps the indicator could be reloaded internally upon the FTOB of the 60-min series? So basically every 60-min candle rollover the indicator would be internally reloaded somehow.

    Any input/insights/suggestions/hacks/tips would be greatly appreciated
    Last edited by molecool; 02-24-2016, 04:20 PM.

    #2
    Hello,

    Thank you for the question.

    To clarify, you said:
    I have a strategy that is set to COBC=false
    and then said:
    Thus the easiest solution would be somehow force the indicator to run COBC=false.
    By default the indicator should follow what the strategy is being set to, did you mean COBC= true for the indicator while COBC= false for the strategy?

    If so it is not possible to dynamically change COBC for a indicator that is referenced from a strategy or Reload that indicator on the fly but you could see this post which explains how to execute logic on the first tick of a bar to simulate COBC = true.



    The samples logic could be applied to the indicator its self, when run on COBC = false like the strategy, instead of running on each tick and re calculating you could choose to only do those calculations on the FirstTick of the bar and then reference 1 bars ago value for the most recent Closed value instead of intrabar values. The comments in the sample further explain the script which you could review to see if this fits in your logic.

    Please let me know if I may be of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Sorry for the confusion, Jesse. I just corrected my description, can you please read it again? Thanks!

      Comment


        #4
        Per the example you posted. Yes, I'm already doing this but to no avail. What's happening internally inside the indicator is that it slides through sequential states. If the highs/lows of the signal pass a certain threshold and trigger that state then it will apparently remain, irrespective if the fact that the candle closed in a state that would not have triggered that state. I hope that is clear as it's crucial to understanding what's going on.

        So that means that the live indicator is being pushed into states the historical is not. At least that is what is happening - whether or not it's supposed to. I am trying to find out how to avoid the intra-candle live swings to affect those thresholds somehow.

        Comment


          #5
          Hello,

          Thank you for editing that for clarity.

          I see the change made was for the indicator set to true instead of false as I had presumed in my answer, my reply would have no changes in this case.

          Please let me know if I may be of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            Hello,

            Unfortunately I would have no insight on the most recent reply.

            The logic you are using is currently unknown to me so I can only observe and recommend what may help based on your description.

            If you have a very simple example you can provide that demonstrates the problem it may be more clear on what is happening in your script.

            The general approach I had recommended should work in most cases but in the case your custom logic does not work the same, likely you would need to further debug or reduce the code to a simplified sample and submit that for further review.

            Please let me know if I may be of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ghoul, Today, 06:02 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            44 views
            0 likes
            Last Post jeronymite  
            Started by Barry Milan, Yesterday, 10:35 PM
            7 responses
            20 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by AttiM, 02-14-2024, 05:20 PM
            10 responses
            180 views
            0 likes
            Last Post jeronymite  
            Started by DanielSanMartin, Yesterday, 02:37 PM
            2 responses
            13 views
            0 likes
            Last Post DanielSanMartin  
            Working...
            X