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

Custom Indicators are not being updated Tick by Tick

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

    Custom Indicators are not being updated Tick by Tick

    Hello, thank you for all of your help so far on inputting my custom indicators.

    Basically, my indicators are being plotted above and below the proper price bars as my conditions are met. However, as price moves tick by tick, the indicators stay plotted even when the conditions are no longer currently met, and incorrectly remain at the close of the pricebar.

    I can set them to calculate on bar close and when the price bar closes everything works fine, and the indicators are plotted properly. However, on short time frames plotting the indicator on the close of the bar doesnt leave enough time for analysis.

    I would like to see the signals update tick by tick...basically appear when all of my conditions are met, and dissappear when they are no longer currently being met. More like an alert of when conditions are being met instead of a final plotting of when they have been met.

    Here is a sample of Ninja Script, any help is much appreciated:

    if(CurrentBar<3)return;if((Low[0]>=Low[3])&&(Close[0]<Close[3])) DrawDiamond("tag1"+ CurrentBar.ToString(),true,0,Low[0]-(TickSize*50),Color.Black);
    }

    Any help is much appreciated, thank you in advance

    #2
    vern13,

    Thank you for your post.

    You would just need to use RemoveDrawObject() for when the condition is not true. Please see the snippet below which should work with the snippet you provided:

    Code:
    if(CurrentBar<3)
    return;
    
    if((Low[0]>=Low[3])&&(Close[0]<Close[3])) 
    DrawDiamond("tag1"+ CurrentBar.ToString(),true,0,Low[0]-(TickSize*50),Color.Black);
    
    else RemoveDrawObject("tag1"+CurrentBar.ToString());
    More information on RemoveDrawObject() from our Help Guide:

    MatthewNinjaTrader Product Management

    Comment


      #3
      Thank you for the help!! The snippet works great, I appreciate the fast attention. You guys are world class.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by AveryFlynn, Today, 04:57 AM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by Max238, Today, 01:28 AM
      4 responses
      37 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by r68cervera, Today, 05:29 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by geddyisodin, Today, 05:20 AM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by timko, Today, 06:45 AM
      2 responses
      14 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Working...
      X