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 cmtjoancolmenero, 04-29-2024, 03:40 PM
      20 responses
      62 views
      0 likes
      Last Post cmtjoancolmenero  
      Started by llanqui, Today, 11:13 AM
      4 responses
      6 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by samish18, 04-17-2024, 08:57 AM
      27 responses
      118 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by ETFVoyageur, 04-30-2024, 02:04 PM
      7 responses
      45 views
      0 likes
      Last Post eDanny
      by eDanny
       
      Started by f.saeidi, Today, 07:07 AM
      5 responses
      16 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X