![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Member
Join Date: Aug 2009
Posts: 34
Thanks: 0
Thanked 1 time in 1 post
|
I thought I found the problem, but apparently I did not. The log is telling me that my McClellan Oscillator, an imported indicator, has an error:
Failed to call method 'Initialize' for indicator 'McClellan Oscillator'; 'Add' method only accepts positive 'period' values, but was -1 Min The category is Default, so I am not to sure where to start looking to fix the error. I am using the McCOsc in several different strategies. Thank you in advance... |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello dunwoodyjr,
Can you tell me does the McClellan Oscillator indicator is a multi series indicator. If so, can you tell, what exact code you have written to Add the the secondary data series. You can find the Add() method in the Initialize section of the indicator. I look forward to assisting you further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Aug 2009
Posts: 34
Thanks: 0
Thanked 1 time in 1 post
|
In one strategy it looks like this:
protected override void Initialize() { Add(TripMOMO(15, 25, 5)); Add(EMA50vs200(200, 50)); Add(RSI(12, 1)); Add(EMA(eMA1st)); Add(ADX(14)); Add(EMA(eMA2nd)); Add(EMA(50)); Add(Bollinger(bBstandarddevside, 20)); Add(McClellanOscillator(19,39)); EMA(eMA1st).Plots[0].Pen.Color = Color.Blue; EMA(eMA2nd).Plots[0].Pen.Color = Color.Black; EMA(50).Plots[0].Pen.Color = Color.Green; McClellanOscillator(19,39).Plots[0].Pen.Color = Color.Chocolate; EntryHandling = EntryHandling.UniqueEntries; SetProfitTarget("Enter Short", CalculationMode.Percent, Closeshort); SetTrailStop("Enter Short", CalculationMode.Percent, Trailingshort, true); CalculateOnBarClose = true; } Thing is, I don't notice it effect the strategy. It compiles fine and runs well. I just keep getting about 15 errors each time I compile or run a back test... |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello dunwoodyjr,
Thank for the code. Unfortunately this is the code which you have used in the Initialize section of the strategy. I need the code of the initialize section of the McClellanOscillator indicator. In Control Center menu bar goto Tools>Edit NinjaScript>Indicators... In the Indicator dialog select McClellanOscillator and click on the Ok button. Please send the code of the Initialize section of the indicator. I look forward to assisting you further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Aug 2009
Posts: 34
Thanks: 0
Thanked 1 time in 1 post
|
{
Add("NYSE_AD", BarsPeriod.Id, BarsPeriod.Value); Add(new Plot(Color.FromKnownColor(KnownColor.Lime), PlotStyle.Line, "McClellanUpper")); Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "McClellanLower")); Plots[0].Min = 0; Plots[1].Max = 0; DrawOnPricePanel = false; Overlay = false; } Sooo, I guess that the "NYSE_AD" is the cause. It does have negative values in it's series. How do I change the code to allow for negative values? Or can I? Thanks!!! |
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello,
The default symbol in NinjaTrader for NYSE Advance decline is ADD. Please change the code Code:
Add("NYSE_AD", BarsPeriod.Id, BarsPeriod.Value);
Code:
Add("ADD", BarsPeriod.Id, BarsPeriod.Value);
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Apr 2012
Posts: 16
Thanks: 0
Thanked 0 times in 0 posts
|
HOw do you erase your past order entry information from being displayed on the chart screen?
|
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello Camron,
Please follow the instructions below to disable the plotting of trade executions.
http://www.ninjatrader.com/support/h...price_data.htm
Joydeep M.
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Log - "Error plotting values to chart data box for indicator" | BrianL | Miscellaneous Support | 10 | 10-27-2012 07:03 AM |
| Error Log | Mindset | Suggestions And Feedback | 3 | 08-17-2010 05:22 AM |
| Help with Log error | huracan | Indicator Development | 4 | 10-01-2009 02:41 PM |
| Missing Indicator Log Error | snaphook | Miscellaneous Support | 5 | 06-05-2009 06:21 AM |
| Error in log | SuzyG | Strategy Development | 4 | 01-17-2007 01:17 AM |