Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

PriorDayOHLC and prices

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

  • Harry
    replied
    Originally posted by VV Cephei View Post
    Thanks Harry for the idea as well as posting that chart.

    I was wondering if someone could help or clear something up for me with the suggestion that Harry made.

    I tried to create a template by going to tools>session manager then I try to change it from the 24/7 default setting. I put it to US Equities RTH. But what's strange is that when I go back into Tools>Session Manager I see that 24/7 default is selected. And it doesn't seem to matter if I change it back or not, each time I go back to session manager it appears that my selection doesn't stay for some reason. I even made my own template and saved it under a name, but when I select it the same thing happens. Once I come back in, the default 24/7 appears to be selected.
    You do not select session templates within the session manager. The session manager is only used to build and store session templates.

    You select the session template when you open a new chart or for existing charts under DataSeries settings. Please be aware that any chart template that you select overrides the session template settings.

    Leave a comment:


  • VV Cephei
    replied
    Thanks Harry for the idea as well as posting that chart.

    I was wondering if someone could help or clear something up for me with the suggestion that Harry made.

    I tried to create a template by going to tools>session manager then I try to change it from the 24/7 default setting. I put it to US Equities RTH. But what's strange is that when I go back into Tools>Session Manager I see that 24/7 default is selected. And it doesn't seem to matter if I change it back or not, each time I go back to session manager it appears that my selection doesn't stay for some reason. I even made my own template and saved it under a name, but when I select it the same thing happens. Once I come back in, the default 24/7 appears to be selected.

    Leave a comment:


  • Harry
    replied
    You can apply a session template to your chart which isolates the regular session within the full session. This allows you to catch the regular open (open of the first bar of the session) and the regular close (close of the last bar of the session). It is better to use the settlement price instead of the regular close. The settelement price can only be taken from daily data, if supplied by your data provider.

    The chart below catches the settlement price from daily Kinetick data and compares it to the open of today's session. The difference is displayed as gap. The gap remains on the chart until it is closed durgin the regular session.

    Today's new gap was insignificant, as today's regular open (4324.50) was only 1 tick below yesterday's settlement price (4324.75). However, there were two open gaps on the chart from February 12 and March 12. Both were closed during the first 3 hours of the regular session.
    Attached Files

    Leave a comment:


  • VV Cephei
    replied
    Hi there, thanks for your help.

    I'm still having some problems, so I attached sample so you could see if I'm on the right track:

    if (Bars.FirstBarOfSession == true)
    {
    double PrevDayClose = Close[0];
    }

    // condition
    if (Open[0] - PrevDayClose > 5 && ToTime(Time[0]) == ToTime(9, 30, 0))
    {
    EnterLong(DefaultQuantity, "");
    }

    I"m getting the message that 'close' and 'prevdayclose' do not exist in this context.

    Leave a comment:


  • NinjaTrader_CalH
    replied
    Hello VV Cephei,

    Thank you for your note.

    Since, 4:00 PM is the first bar of the session you could use -
    Code:
    if(Bars.FirstBarOfSession)
    double openPrice = Close[0];
    You can than take openPrice and compare it to Open[0] at 9:30 AM

    http://www.ninjatrader.com/support/h...rofsession.htm

    Let me know if I can be of further assistance.

    Leave a comment:


  • VV Cephei
    started a topic PriorDayOHLC and prices

    PriorDayOHLC and prices

    Hello,

    I'd like to get the value, for example, of the NQ or ES at 4:00pm EST yesterday, and compare it to the value at the open 9:30am EST this morning. I know using the PriorDayOHLC will return values from different times than the ones I'd like.

    I suppose I could compare the open[0] to close[900] or how many ever bars ago, but I'm sure that's an inefficient way of doing it. Is there a simpler way of doing it? Thank you for your help!

Latest Posts

Collapse

Topics Statistics Last Post
Started by bortz, 11-06-2023, 08:04 AM
47 responses
1,607 views
0 likes
Last Post aligator  
Started by jaybedreamin, Today, 05:56 PM
0 responses
9 views
0 likes
Last Post jaybedreamin  
Started by DJ888, 04-16-2024, 06:09 PM
6 responses
19 views
0 likes
Last Post DJ888
by DJ888
 
Started by Jon17, Today, 04:33 PM
0 responses
6 views
0 likes
Last Post Jon17
by Jon17
 
Started by Javierw.ok, Today, 04:12 PM
0 responses
16 views
0 likes
Last Post Javierw.ok  
Working...
X