Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Printing Bar Values

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

    Printing Bar Values

    Hey guys, I have a question about the values that I'm getting when I print out bar values from my strategies and bar series. I have 2 series in a strategy the primary is 60 minute and the secondary is 1 minute like this:

    Assuming this is 1 minute:
    if (BarsInProgress == 1)
    {
    Print("Inside the Second bar series." + Instrument.FullName + " " + Time[0] + " " + Times[1][0] + " Prices: " + Close[0] + " " + Closes[2][0] + " " + Closes[1][0]);
    }

    Assuming this is 60 minute:
    if (BarsInProgress == 0)
    {
    }

    The results from the print statement are a bit unexpected. For example the symbol A for the 1030am 60 minute bar just closed at 42.51, but when I print the bar using Closes[2][0] from the 1 minute series above it changes the value, currently at 42.33, is the strategy redrawing the 60 minute bar everytime it executes or am i missing something? How do I display last close for the 60 minute bar inside the 1 minute series so that it displays 42.51?

    Thanks,
    EliteTraderNYC

    #2
    Hello EliteTraderNYC,

    Thank you for your post.

    How many bar series are added to the code?

    I see you are using Closes[2][0], this would call the third bar series in your code (being the second instrument and/or period type you added using Add()).

    Can you provide all bar series added? Or just the Initialize() method code where you add the bar series?

    In addition, please provide the text form your Output window so I may investigate this matter further.

    I look forward to your response.

    Comment


      #3
      My mistake, I think I should have been using Closes[0][0], this works just like I expected.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      50 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X