![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
|
Hi,
I wish to set such a condition in my startegy: Current Asking Price is bigger than Session Opening Price (at 9:30). Below, I attach part of a code, please take a look at that and say what I did wrong. I compiled this code and strategy works fine, but it triggers despite a condition is NOT done. protected override void OnBarUpdate() { if (ToTime(Time[0]) >= 93000 && ToTime(Time[0]) <= 160000) { int opening = GetBar(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 9, 30, 0)); { if (GetCurrentAsk() > Close[opening]); { //do sth }}}} |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
For opening just use the CurrentDayOHL() indicator.
More information - http://www.ninjatrader-support.com/H...entDayOHL.html
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
|
Well,
it was surprisingly easy - I solved that in a St Wizard. Thanks Ray for good advice. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Plot High Low of a specific time | vidda | Indicator Development | 5 | 08-27-2008 12:51 PM |
| How to get the highest/lowest close of a specific time range. | strategy1 | General Programming | 4 | 07-23-2008 10:18 PM |
| How to access price range of specific time period. | strategy1 | General Programming | 1 | 07-22-2008 03:18 PM |
| Plots during specific time frame | blaporte | Indicator Development | 1 | 01-19-2008 02:55 PM |
| Price data on specific time frame. | The Shadow | Indicator Development | 4 | 03-17-2007 01:04 PM |