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 Waxavi, Today, 02:00 AM
      0 responses
      2 views
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Started by elirion, Today, 01:36 AM
      0 responses
      4 views
      0 likes
      Last Post elirion
      by elirion
       
      Started by gentlebenthebear, Today, 01:30 AM
      0 responses
      4 views
      0 likes
      Last Post gentlebenthebear  
      Started by samish18, Yesterday, 08:31 AM
      2 responses
      9 views
      0 likes
      Last Post elirion
      by elirion
       
      Started by Mestor, 03-10-2023, 01:50 AM
      16 responses
      391 views
      0 likes
      Last Post z.franck  
      Working...
      X