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 Javierw.ok, Today, 04:12 PM
      0 responses
      4 views
      0 likes
      Last Post Javierw.ok  
      Started by timmbbo, Today, 08:59 AM
      2 responses
      10 views
      0 likes
      Last Post bltdavid  
      Started by alifarahani, Today, 09:40 AM
      6 responses
      40 views
      0 likes
      Last Post alifarahani  
      Started by Waxavi, Today, 02:10 AM
      1 response
      18 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by Kaledus, Today, 01:29 PM
      5 responses
      15 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X