Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Multiseries Problem
Collapse
X
-
Multiseries Problem
I am trying to create a simple multi-series indicator, but I can't the following code to work. I read the manual and the example strategy, but I don't see why it isn't working. I thought it might be the symbol, but I have used every combination I can think of, e.g. EURUSD, $EURUSD, EUR.USD, $EUR.USD, EUR/USD, $EUR/USD. Even if I use "MSFT" as in the example, I am getting the same error. Thanks for any help.Tags: None
-
-
-
Yes, you can just set in Initialize():
EDIT: Perhaps I pulled the trigger too quick on the reply. Overlay is the property that decides if the indicator should be plotted on top of the price or not.Code:Overlay = false;
Last edited by NinjaTrader_Austin; 03-09-2010, 04:20 PM.AustinNinjaTrader Customer Service
Comment
-
Everyone seems to do it this way, but it says 'The name strategyplot does not exist in the current context' and won't compile. Not sure what is wrong.
Initialize()
{
Add("AUDUSD", PeriodType.Minute, timeFrame);
Add("GBPCHF", PeriodType.Minute, timeFrame);
Add("EURUSD", PeriodType.Minute, timeFrame);
Add("EURCHF", PeriodType.Minute, timeFrame);
Add("NZDJPY", PeriodType.Minute, timeFrame);
Add("CHFJPY", PeriodType.Minute, timeFrame);
Add("USDJPY", PeriodType.Minute, timeFrame);
Add(StrategyPlot(0));
StrategyPlot(0).PanelUI = 2;
CalculateOnBarClose = false;
}
OnBarUpdate()
{
if (BarsInProgress == 0)
{
double Index1 = Closes[1][0] + Closes[2][0] + Closes[3][0] + Closes[4][0] + Closes[5][0] + Closes[6][0] + Closes[7][0];
StrategyPlot(0).Value.Set(Index1);
}
}
Thank you
Attached Files
Comment
-
Do you actually have the underlying indicators in your files, too to achieve this functionality?
When running a strategy on a chart you may find the need to plot values onto a chart. If these values are internal strategy calculations that are difficult to migrate to an indicator, you can use the following technique to achieve a plot. NinjaTrader 8 With NinjaTrader 8 we introduced strategy plots which provide the ability
Comment
-
-
Spoke to quickly, it compiles, but nothing plots. I tried removing the timeFrame parameter and hard keying "5", I changed all the StrategyPlot(0) to StrategyPlot(1) in case the number correlated with the id in the strategy plot indicator?, I commented out the double statement and changed StrategyPlot(1).Value.Set(Index1); to StrategyPlot(1).Value.Set(Closes[1][0]) to simplify that part of it. At this point I'm out of ideas.Attached Files
Comment
-
So I just took the sample strategy and replaced your code with mine and it still doesn't work. The panel shows up but it is empty. Hmm?
protectedoverridevoid Initialize()
{
CalculateOnBarClose = true;
Add("AUDUSD", PeriodType.Minute, 5);
Add("GBPCHF", PeriodType.Minute, 5);
Add(StrategyPlot(0));
Add(StrategyPlot(1));
StrategyPlot(0).Plots[0].Pen.Color = Color.Blue;
StrategyPlot(1).Plots[0].Pen.Color = Color.Red;
StrategyPlot(0).PanelUI = 3;
StrategyPlot(1).PanelUI = 3;
protectedoverridevoid OnBarUpdate()
{
StrategyPlot(0).Value.Set(Closes[1][0]);
StrategyPlot(1).Value.Set(Closes[2][0]);
}
Comment
-
Ok, went back to what I tried earlier, currency symbols must have the "$" prefix - "$GBPUSD", not "GBPUSD".
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
656 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
371 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
579 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|
Comment