protected override void Initialize()
{
CalculateOnBarClose = true;
Add("ES ##-##", PeriodType.Day, 1);
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
// Long Entry #1
if (CrossAbove(SMA(5), SMA(20), 1))
{
EnterLong(1, DefaultQuantity, "LEn1");
}
// Long Exit #1
if (CrossBelow(SMA(5), SMA(20), 1))
{
ExitLong(1, "LEx1", "LEn1");
}
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Trade /ES on VIX chart
Collapse
X
-
Trade /ES on VIX chart
Hello, I would like to run a strategy on a VIX chart (primary bars), but place trades on /ES (secondary bars). I have cobbled together example code below, however, it doesn't do what I want to achieve. Any help on how to do this would be appreciated.
Code:Tags: None
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by sjsj2732, Yesterday, 04:31 AM
|
0 responses
30 views
0 likes
|
Last Post
by sjsj2732
Yesterday, 04:31 AM
|
||
|
Started by NullPointStrategies, 03-13-2026, 05:17 AM
|
0 responses
286 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
282 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
132 views
1 like
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
90 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|

Comment