Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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():
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 abilityBertrandNinjaTrader Customer Service
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 usazencort, Today, 01:16 AM
|
0 responses
1 view
0 likes
|
Last Post
by usazencort
Today, 01:16 AM
|
||
Started by kaywai, 09-01-2023, 08:44 PM
|
5 responses
603 views
0 likes
|
Last Post Today, 12:32 AM | ||
Started by xiinteractive, 04-09-2024, 08:08 AM
|
6 responses
22 views
0 likes
|
Last Post Today, 12:31 AM | ||
Started by Pattontje, Yesterday, 02:10 PM
|
2 responses
21 views
0 likes
|
Last Post
by Pattontje
Yesterday, 11:49 PM
|
||
Started by flybuzz, 04-21-2024, 04:07 PM
|
17 responses
230 views
0 likes
|
Last Post
by TradingLoss
Yesterday, 11:45 PM
|
Comment