Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Time Trail
Collapse
X
-
Hello fercgv,
If the chart is a minute chart you could wait two bars.
Select Misc > Bars since entry on the left, Equals, Misc > Numeric value with 'Numeric value' set to 2 on the left.
If the chart is not a minute chart, you would need to unlock the script and code by hand.
private DateTime entryTime;
In OnStateChange():
else if (State == State.Configure)
{
AddDataSeries(BarsPeriodType.Minute, 1);
}
In OnBarUpdate():
if (BarsInProgress == 0 /* && conditions to enter */)
{
EnterLong();
entryTime = Time[0];
}
if (BarsInProgress == 1)
{
if (Position.MarketPosition == MarketPosition.Long && Time[0].Subtract(entryTime).Minute >= 2)
{
ExitLong();
}
}Chelsea B.NinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
116 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
61 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
40 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
43 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
82 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment