Resolve issue where OR levels were not updated correctly if using non-time based bars and regular trading hours
This commit is contained in:
parent
5b6c31ecfc
commit
a4cfe65a4e
@ -108,6 +108,13 @@ namespace NinjaTrader.NinjaScript.Indicators
|
||||
DateTime marketOpen = now.Date + Session.GetTradingDayBeginLocal(Session.ActualTradingDayExchange).TimeOfDay;
|
||||
DateTime marketClose = now.Date + Session.GetTradingDayEndLocal(Session.ActualTradingDayExchange).TimeOfDay;
|
||||
|
||||
if (now.Date != OpeningRangeDate)
|
||||
{
|
||||
OpeningRangeHigh = 0.0;
|
||||
OpeningRangeLow = 0.0;
|
||||
OpeningRangeMid = 0.0;
|
||||
}
|
||||
|
||||
if (BarsInProgress == 0)
|
||||
{
|
||||
ORH[0] = OpeningRangeHigh;
|
||||
@ -132,13 +139,6 @@ namespace NinjaTrader.NinjaScript.Indicators
|
||||
OpeningRangeMidStroke.Brush, OpeningRangeMidStroke.DashStyleHelper, (int)OpeningRangeMidStroke.Width);
|
||||
}
|
||||
|
||||
if (now >= marketClose)
|
||||
{
|
||||
OpeningRangeHigh = 0.0;
|
||||
OpeningRangeLow = 0.0;
|
||||
OpeningRangeMid = 0.0;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user