protected override void OnBarUpdate()
{
//PrintWithTimeStamp("cond2 = " + cond2.ToString ());
//PrintWithTimeStamp("cmeRth = " + cmeRth.ToString ());
cond2 = (CrossAbove( bClose(BarsArray[1],bCloseMult), EMA(Highs[1],bCloseSmaLen)[0],1) ? 1 : 0 ) ;
limitPrice = Instrument.MasterInstrument.Round2TickSize(Klose(BarsArray[1],1,1,1,1)[0]) -
(Instrument.MasterInstrument.Round2TickSize(GMA(BarsArray[1],myPriceRangeLen)[0] * myPriceRangeFactor));
cmeRth = ( ToTime(Time[0]) > 85000 && ToTime(Time[0]) < 144500 ? 1:0);
//if (ToTime(Time[0]) < ToTime(08,50,00)) return;
if (BarsInProgress == 1)
{
//PrintWithTimeStamp("cme = " + cmeRth.ToString ());
#region Long Entry
if (Position.MarketPosition == MarketPosition.Flat && cmeRth == 1 )
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Time
Collapse
X
-
Time
Can someone tell me how in heck the code below the if flat and cmeRth=0 code could be executing before 850am.
Code:Last edited by neb1998; 11-13-2011, 10:12 PM.Tags: None
-
Hi neb1998, they would work down to the second -
'Integer representation of time is in the following format Hmmss where 7:30 AM would be 73000 and 2:15:12 PM would be 141512.'
But you would not know when the bar exactly ends on tick based charts, so try defining a time region and then return out of the calcs once the first occurrence evaluated 'true'.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
152 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
89 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
131 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
127 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
107 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment