Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Update Mehtod

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

    #16
    Hi Patrick,

    So i how have updated my strategy to update my own Data series once the FirstTickOfBar == True; and I am now expecting LinReg of both Closes[1] (10 Min Bars) and fastClose (Based on 10 Min Bars), to be the same but they still are not and Im not sure why. I have attached a script to demonstrate the probelm.
    Attached Files

    Comment


      #17
      Hello GKonheiser,

      There is no need for the Historical or CalculateOnBarClose check. On the first tick of the bar I would also set it as the following:
      Code:
      						// set fastClose index 1 to the 10 min bar just closed 
      						fastClose.Set(1, Closes[1][1]);
      						fastClose.Set(0, Closes[1][0]);
      So both the prior bar is set and the current tick.

      Comment


        #18
        Im doing the check for historical or CalculateOnBarClose as in that case on the FirstTickOrBar my customDataSeries index 1 would be Closes[1][0] where as if we are running on live data with CalulateOnBarClose == false it would be Closes[1][1].

        Is that logic not correct ?

        Comment


          #19
          There should be no need to perform it in that way, I would use the code below only:
          Code:
          if( BarsInProgress == 1 )
          			{
          				...				
          				// FIRST TICK OF BAR SO SET OUR DATA SERIES
          				if(FirstTickOfBar)
          				{
          					...
          						// set fastClose index 1 to the 10 min bar just closed 
          						fastClose.Set(1, Closes[1][1]);
          						fastClose.Set(0, Closes[1][0]);

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by SalmaTrader, 07-07-2026, 10:26 PM
          0 responses
          47 views
          0 likes
          Last Post SalmaTrader  
          Started by CarlTrading, 07-05-2026, 01:16 PM
          0 responses
          22 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 06-17-2026, 10:32 AM
          0 responses
          15 views
          0 likes
          Last Post CaptainJack  
          Started by kinfxhk, 06-17-2026, 04:15 AM
          0 responses
          21 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Started by kinfxhk, 06-17-2026, 04:06 AM
          0 responses
          23 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Working...
          X