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 not updating

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

    indicator not updating

    I have a problem with an indicator I've coded. this indicator is supposed to plot arrows (up&down) giving me entry and exit signals but when I run the script on my chart , it does not update. I need to reload Ninjascript manually each time to see the last signal.
    here is the code :

    if (CurrentBar<slow)
    return;

    FastMA.Set(MaGauss(fast,
    3)[0]);
    SlowMA.Set(MaGauss(slow,
    3)[0]);
    Trend.Set(KeoBullBear(avg,smoothing)[
    0]);

    if ( CrossAbove(FastMA,SlowMA,1) && Trend[0]>0 && Condition1==true)
    {
    DrawArrowUp(
    "Long"+CurrentBar,false,0,Low[0]-TickSize,Color.Yellow);
    Condition1=
    false;
    Condition2=
    true;

    }
    if (CrossBelow(FastMA,SlowMA,1) && Trend[0]<0 && Condition2==true)
    {
    DrawArrowDown(
    "Short"+CurrentBar,false,0,High[0]+TickSize, Color.Magenta);
    Condition2=
    false;
    Condition1=
    true;
    }

    May someone help ?

    #2
    You will need to debug your indicator. Use Print() throughout your code to track it and see why it just stops. Also check the Control Center log for errors.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      no error message on the log. This is really weird.

      Just look at this screenshot :


      how can it plot a yellow down arrow considering the code I showed you (my down arrows should all be magenta) ?

      Is this a bug ?

      Comment


        #4
        Please use only this indicator and no other indicators when debugging. Your indicator will only behave however you have it coded. Please use Print() to track your indicator and see where you should/should not be drawing arrows.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Print ? but what ? Print my drawing method ? I'm afraid I don't understand ?

          Comment


            #6
            Please see this article: http://www.ninjatrader-support.com/v...ead.php?t=3418
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              kuroro13.

              If you export your indicator and post it I will take a look.
              mrlogik
              NinjaTrader Ecosystem Vendor - Purelogik Trading

              Comment


                #8
                I found the problem but I don't know how to resolve it.

                It has to do with the CalculateonBarClose method.

                My MaGauss and my keobullbear are set to true, so is my indicator.
                When I set everything to false it automatically plots arrows but not on bar close.
                When set to true, it never updates unless I reload ninjascript manually.

                I'd like it to be updated at the close of each bar.
                What can I do ?

                Comment


                  #9
                  kuroro13,

                  We do not know unless you post the entire code or export it as mrlogik requested. Thanks.

                  But what you can try is adding an instance of each indicator you are using to the strategy.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    here is the ninjascript
                    Attached Files

                    Comment


                      #11
                      kuroro13,

                      You have 3 indicators here. Which one is the one you have problems with?
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        the one named K...shlg

                        Comment


                          #13
                          kuroro13,

                          This may be a bug. In the meantime please comment out your CalculateOnBarClose lines in your indicators. Then it will work with them on false or true.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            ok I will try this.
                            Hope this bug will be fixed soon.

                            Comment


                              #15
                              still not working. This is really frustrating

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by pmachiraju, 11-01-2023, 04:46 AM
                              8 responses
                              148 views
                              0 likes
                              Last Post rehmans
                              by rehmans
                               
                              Started by mattbsea, Today, 05:44 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post mattbsea  
                              Started by RideMe, 04-07-2024, 04:54 PM
                              6 responses
                              33 views
                              0 likes
                              Last Post RideMe
                              by RideMe
                               
                              Started by tkaboris, Today, 05:13 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post tkaboris  
                              Started by GussJ, 03-04-2020, 03:11 PM
                              16 responses
                              3,282 views
                              0 likes
                              Last Post Leafcutter  
                              Working...
                              X