• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator F5

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

    Indicator F5

    Hello,

    I´m experiencing a strange issue that I have never had before in 10 years. An indicator (running with COBCtrue) does not plot correct the drawings from conditions. Only when I click F5 then all drawings are immediately correct in the chart. What might be the reason for this please?

    Thank you!
    Tony

    #2
    Hello tonynt,

    Thank you for the post.

    Just to confirm is this a custom indicator or a platform indicator?

    If the indicator is not plotting correctly in realtime you would likely need to review the parts of your script that deals with realtime. When reloading with F5 your script will reprocess all the bars as historical so that would give a hint that some of your realtime logic is not working as expected. If you have any filters like if(State == State.Realtime) you may want to check that portion of the logic.

    If the indicator has been working and just stopped working I would suggest first trying some basic troubleshooting steps such as removing the indicator from where it is applied, restarting the platform and then reloading historical data before re applying it.

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

    Comment


      #3
      Hello,

      thank you for your reply. Its a custom indicator: I use the orderflowcumulativedelta (with same code as in a strategy where it is working ok), means I have
      else if (State == State.Configure)
      {
      AddDataSeries(Data.BarsPeriodType.Tick, 1);
      }
      else if (State == State.DataLoaded)
      {
      OrderFlowCumulativeDelta1 = OrderFlowCumulativeDelta(Close, NinjaTrader.NinjaScript.Indicators.CumulativeDelta Type.BidAsk, NinjaTrader.NinjaScript.Indicators.CumulativeDelta Period.Session, 0);
      }

      and in onbarupdate eg
      if(
      OrderFlowCumulativeDelta1.DeltaClose[0] < OrderFlowCumulativeDelta1.DeltaOpen[0])
      {
      if(Closes[0][0]<Opens[0][0]
      ....


      Thats it. What might be the reason from this simple code that there are plotted more dots than should be from calculation, and only when I click F5 the wrong dots are removed and from all the dots the correct ones are only plotted now as they should.

      Thank you!
      Tony
      Last edited by tonynt; 11-11-2019, 02:56 PM. Reason: translation error

      Comment


        #4
        Hello tonynt,

        Thank you for the reply.

        You noted that this is all the code you have used however the sample for OrderFlowCumulativeDelta has more to it, do you have the complete code from the help guide in your script? https://ninjatrader.com/support/help...umulativeDelta

        The sample shows what is required, the BIP 1 logic is necessary do you have that?

        You didn't include any BarsInProgress checks in your sample, are you using any and which is this code being executed from?

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

        Comment


          #5
          Hello Jesse,

          thank you for your reply. Yes, I forgot to add the BIP1 logic. I have now
          ifBIP==0 (logic of indicator for plotting)
          if (BarsInProgress == 1)
          {OrderFlowCumulativeDelta1.Update(OrderFlowCumulat iveDelta1.BarsArray[1].Count - 1, 1); // note that I changed the name to what the strategy builder created.}

          but it still plots where condition is not true and only after F5 persist the plottings that are correct.

          ??

          Thank you!
          Tony

          Comment


            #6
            Hello tonynt,

            From the added details I would not be certain what the problem is, do you have a simplified sample script that you can provide that demonstrates the issue? I would mainly need to see how the indicator is being used and what is being plotted in addition to the steps to see the issue. .



            I look forward to being of further assistance.

            JesseNinjaTrader Customer Service

            Comment


              #7
              Hello Jesse,

              thank you for your reply. I attach a simplified code.

              Tony
              Attached Files

              Comment


                #8
                Hello tonynt,

                Before we continue with this sample can you check if removing the following line makes a difference in your test?

                Code:
                if (BarsInProgress != 0) 
                                return;
                



                Later in the file you have:

                Code:
                    if (BarsInProgress == 1)  // This is the code example from the help guide, it runs when the 1 tick series calls OnBarUpdate and is needed to sync the values.
                            {
                                  // We have to update the secondary series of the hosted indicator to make sure the values we get in BarsInProgress == 0 are in sync
                                  OrderFlowCumulativeDelta1.Update(OrderFlowCumulativeDelta1.BarsArray[1].Count - 1, 1);   // note that I changed the name to what the strategy builder created.
                //                OrderFlowCumulativeDelta2.Update(OrderFlowCumulativeDelta2.BarsArray[1].Count - 1, 1);    // note that I changed the name to what the strategy builder created.
                            }
                This code won't run because you already had returned if BarsInProgress was not 0. BarsInProgress 1's logic is not being executed with the current conditions.


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

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by tvaughan4, Today, 10:46 PM
                0 responses
                0 views
                0 likes
                Last Post tvaughan4  
                Started by digibob, Today, 10:01 PM
                0 responses
                1 view
                0 likes
                Last Post digibob
                by digibob
                 
                Started by ptertich, Today, 09:59 PM
                0 responses
                1 view
                0 likes
                Last Post ptertich  
                Started by sledge, Today, 06:11 PM
                1 response
                9 views
                0 likes
                Last Post sledge
                by sledge
                 
                Started by Bionian, Today, 02:46 PM
                2 responses
                9 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X