Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

General Question

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

    General Question

    I made a simple code:

    Code:
     if(ToTime(Time[0]) == 93000) { Print("Occurred"); }
    within a 30 day chart.

    Why does this code print out more then 30 times? It prints it over 7000 times for each bar. Shouldn't it just print 30 times... once for each day?

    #2
    Maciek, in which kind of chart / timeframe have you applied this script / conditon?

    Comment


      #3
      I have this in a 1 minute chart, but my chart also incorporates information from the tick chart... using

      Code:
      Add(PeriodType.Tick, 1);
      How can I prevent my code from using that tick chart in that instance. Its weird since it is applied to a 1 minute chart but uses the tick chart data.

      Comment


        #4
        If you added a series in, then all series will call the OnBarUpdate() method, triggering your code.

        To select which series calls should make it through, you would need to filter code parts by using BarsInProgress -

        Comment


          #5
          Ohh nice. thats cool thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          157 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          91 views
          1 like
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          143 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          131 views
          1 like
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          107 views
          0 likes
          Last Post CarlTrading  
          Working...
          X