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

Every tick triggered twice

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

    Every tick triggered twice

    Hello,

    I build a little strategy. On State.Configure I add a new dataseries:
    else if (State == State.Configure)
    {
    AddDataSeries(Data.BarsPeriodType.Tick, 1);
    }
    Now, when I use the Analyzer and choose an Instrument and the Type "Tick" with the value of "1" happens following:
    protected override void OnBarUpdate()
    {
    if (BarsInProgress == 1)
    {
    Print(Time[0] + " Tick: " + Close[0] + " @ " + Volume[0]);
    }
    }
    Every tick will be triggered twice on the OnBarUpdate event on this dataseries. If you choose something other than "Tick 1" on the Analyzer, every tick will be triggered once (that should be normal).
    Is it wanted that way or is it a bug? How can I avoid this behavior?

    Thanks,

    Peter

    #2
    Hello plorenz,

    Welcome to the NinjaTrader support forum.

    I wanted to ask, is this being run in an optimization or a backtest?

    Also, could you provide more details on the current configuration you have for the analyzer? It would be helpful to know the instrument used for testing. If you can provide an image of the settings used that would be helpful.

    Additionally, if you have a test script you can attach, it would be helpful to see the other properties you have configured in the script.

    I tried a simple test already but dont see that I am receiving duplicate prints while using 1 tick. I see quite a few unique values.

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

    Comment


      #3
      Hello Jesse,

      Thanks for your reply!
      There is the codesnippet and the analyzer's settings on the attachment.

      Peter
      Attached Files

      Comment


        #4
        Hello,

        Thank you for providing the information. I am currently reviewing this and will reply back here once I have more details. I do see that you are using TickReplay which is a large difference between our prior tests. I do see this relates to using TickReplay with the other strategy settings used, I will need to determine if this would be expected based on the factors in the script.

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

        Comment


          #5
          Hello,

          I just wanted to provide an update. While testing this on the current public release, I am able to see the script printing abnormally but I do see that testing in the current internal release I am unable to replicate the problem. I will need to monitor this further to see if anything changes or if I can continue to reproduce this in any way. It is too early to say that this has been corrected but it would seem to be the case. I will update this thread as I have further details.


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

          Comment


            #6
            Hello,

            I just wanted to reply back on this item.

            After further research we wanted to gather further details on the use case here. In this situation this would be expected based on the series being used. This sample also does not make sense for a real use case as you are trying to add duplicate series. Was there a specific reason for using a 1 tick series in addition to tick replay while the Primary series is a 1 tick series, or was this the only case where you could achieve this result to demonstrate this?

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

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by sidlercom80, 10-28-2023, 08:49 AM
            170 responses
            2,270 views
            0 likes
            Last Post sidlercom80  
            Started by Irukandji, Yesterday, 02:53 AM
            2 responses
            17 views
            0 likes
            Last Post Irukandji  
            Started by adeelshahzad, Today, 03:54 AM
            0 responses
            3 views
            0 likes
            Last Post adeelshahzad  
            Started by CortexZenUSA, Today, 12:53 AM
            0 responses
            3 views
            0 likes
            Last Post CortexZenUSA  
            Started by CortexZenUSA, Today, 12:46 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Working...
            X