Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Time Frame. Reference correspondent Close value through the loop

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

    Multiple Time Frame. Reference correspondent Close value through the loop

    Hi,
    Is it possible to access correspondent Close value of another time frame, going through the loop on the master time frame. Example:

    double closeArray0 = 0;
    double closeArray1 = 0;
    for (int i = 0; i < 100; i++)
    {
    if (Closes[0][i] < Closes[0][i + 1])
    {
    closeArray0 = Closes[0][i];
    closeArray1 = Closes[1][?];
    break;
    }
    }

    Thank you

    #2
    Hello Tatiana,

    Thank you for your post.

    Can you clarify what you mean by the corresponding close for the secondary series?
    Would this be the close at the same time or the same price?

    Comment


      #3
      Yes, I mean correspondent by the same time

      Comment


        #4
        Hello Tatiana,

        Thank you for your response.

        What are the two series in this case? Are they time based like Minute or Day? Or tick based like Tick, Range or Renko?

        The tick based bars have no set time to close so this calculation would be a bit more complicated. If it was a time based bar the calculation would be the following:
        Code:
        			if(CurrentBars[0] <= 100 || CurrentBars[1] <= 100)
        				return;
        			
        			double closeArray0 = 0;
        			double closeArray1 = 0;
        			for (int i = 0; i < 100; i++)
        			{
        				if (Closes[0][i] < Closes[0][i + 1])
        				{
        					closeArray0 = Closes[0][i];
        					for (int j = 0; j < CurrentBars[1]; j++)
        					{
        						if(Times[0][i] == Times[1][j])
        						{
        							closeArray1 = Closes[1][j];
        							break;
        						}
        					}
        					break;
        				}

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        142 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        81 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        125 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        120 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        98 views
        0 likes
        Last Post CarlTrading  
        Working...
        X