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

alerts showing time stamp from a secondary data series

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

    alerts showing time stamp from a secondary data series

    A few of my multi-time frame indicators are showing the time stamp for the secondary data series on the alert message which is the higher time frames time period ([1] array) when the alert is going out on the primary data series( [0] array). It only happens on some of the alerts but not all of them which is why its confusing. The main data series alert is triggered by conditions occurring on the main data series in addition to a boolean value generated by condition from the higher time frame which is called via barsinprogress == 1. My guess is that the order the inputs come in for the alert is what determines what time stamp shows up on the alert. If this is the case maybe it can be fixed by using a nested if statement for the main data series condition or maybe I need to use barsinprogress == 0 for the main data series alert. Please let me know how to resolve this because I only want these alerts to show the main data series time frame to avoid confusion.

    #2
    Hello gordongekko,

    Thanks for your post.

    Based on your description it does sound like one of the added data series is firing OnBarUpdate() when the alert condition is detected.

    If you only want the alert sent from the chart bars time stamp then using a BarsInProgress check would help.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      If I gate my primary data series alert behind if BarsInProgress == 0 then I'm assuming it should send out the alert showing the primary data series in the time stamp.Is this correct? Currently, it uses conditions from the main data series and a boolean value obtained from a higher time frames conditions (that are only checked via BarsInProgress == 1) that must be true as part of the conditions for the alert but the main data series alert is not set to only run if that main data series is being called.
      Last edited by gordongekko; 01-09-2018, 10:50 AM.

      Comment


        #4
        Hello gordongekko,

        Thanks for your reply.

        Not having seen your code it is difficult to advise with clarity, however, if you only want the Alert() to fire on BarsInProgress = 0 then you can change just your alerts conditions like:

        if (your various alert conditions && BarsInProgress == 0)
        {
        Alert(....);
        }
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          I set the alerts to only fire if barsinprogress == 0 and that solved the problem. I assumed this would work since it can't call both data series simultaneously via onbarupate and since the primary data series is always called first I just didn't think using barsinprogress for the main data series was necessary but apparently it is. Thanks for you help.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by trilliantrader, Today, 03:01 PM
          1 response
          4 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by geddyisodin, Today, 05:20 AM
          6 responses
          34 views
          0 likes
          Last Post geddyisodin  
          Started by pechtri, 06-22-2023, 02:31 AM
          9 responses
          122 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by frankthearm, 04-18-2024, 09:08 AM
          16 responses
          67 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by habeebft, Today, 01:18 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X