NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > Application Technical Support > Miscellaneous Support > Historical Version 7 Beta Threads > Version 7 Beta General Questions & Bug Reports

Version 7 Beta General Questions & Bug Reports Ask questions here and post bug reports.

 
 
Thread Tools Display Modes
Old 07-27-2010, 10:45 AM   #1
adamus
Senior Member
 
Join Date: Apr 2010
Posts: 1,058
Thanks: 33
Thanked 2 times in 1 post
Default Adding an indicator in a strategy - abort, retry, ignore

I just wrote an indicator and tested it on a chart and it all looks OK.

I then added it to a strategy so I can compare the indicator to the trades, but it throws this error:

Assertion failed: abort, retry, ignore?
IndicatorBase.InputInitialize
followed by a stacktrace.

I tried removing all my script from my indicator so that it's just a shell with nothing in the event methods, but it still happens.

I have added it in the same way in the strategy's initialize method as I added the other indicators I am using.

What is this InputInitialize assertion? What am I doing wrong or is there any way I can fix this?

Thanks
adamus is offline  
Old 07-27-2010, 11:07 AM   #2
NinjaTrader_Tim
NinjaTrader Customer Service
 
NinjaTrader_Tim's Avatar
 
Join Date: Nov 2009
Location: Denver, CO
Posts: 1,424
Thanks: 0
Thanked 3 times in 3 posts
Default

Hi adamus,

Can you please clarify how you "added this to a strategy"? Did you move code to the strategy? Call if from a strategy?
NinjaTrader_Tim is offline  
Old 07-27-2010, 11:15 AM   #3
adamus
Senior Member
 
Join Date: Apr 2010
Posts: 1,058
Thanks: 33
Thanked 2 times in 1 post
Default

It's the indicator called PivotPoint. This is the code from my strategy. The volatility indicator is added fine, the PivotPoint crashes it:

Code:
        private Indicator.Indicator pivotPoint;
        private Indicator.Indicator volatility;
        // time frame / barsInProgress / Bars index
        private int longTF = 0;
        private int oneMin = 1;
        private OrderBook orderBook;
        private List<double> widths = new List<double>();

        protected override void Initialize()
        {
            TraceOrders = false;
            CalculateOnBarClose = true;
            TimeInForce = Cbi.TimeInForce.Gtc;
            ExitOnClose = false;
            Add(PeriodType.Minute, 1);
            pivotPoint = new PivotPoint();
            pivotPoint.Overlay = true;
            Add(pivotPoint);
            volatility = SmoothMA(Day2Day(), maLength);
            volatility.Plots[0].Pen.Color = Color.Green;
            volatility.Panel = 1;
            volatility.Overlay = true;
            Add(volatility);
        }
adamus is offline  
Old 07-27-2010, 01:20 PM   #4
NinjaTrader_Tim
NinjaTrader Customer Service
 
NinjaTrader_Tim's Avatar
 
Join Date: Nov 2009
Location: Denver, CO
Posts: 1,424
Thanks: 0
Thanked 3 times in 3 posts
Default

Hi adamus,

Adding the indicators in this way is unfortunately beyond the scope of support we can offer. The supported method of doing this can be seen in this sample:
http://www.ninjatrader.com/support/f...ead.php?t=6651
NinjaTrader_Tim is offline  
Old 07-27-2010, 02:53 PM   #5
adamus
Senior Member
 
Join Date: Apr 2010
Posts: 1,058
Thanks: 33
Thanked 2 times in 1 post
Default

Tim,

that sample says explicitly that it's not for backtesting. Are you sure it's the one you had in mind?
adamus is offline  
Old 07-27-2010, 04:31 PM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

adamus,

The purpose of that link was not for backtesting or using the concepts in the sample, but more to show you how the indicator is added. There is no indicator variable created. Just add the indicator you want directly and set the properties you want accordingly directly. This would be more appropriate: http://www.ninjatrader.com/support/f...ead.php?t=3228
NinjaTrader_Josh is offline  
Old 07-27-2010, 04:56 PM   #7
adamus
Senior Member
 
Join Date: Apr 2010
Posts: 1,058
Thanks: 33
Thanked 2 times in 1 post
Default

OK, thanks but when I tried coding

Code:
Add(PivotPoint());
NT wouldn't compile but gave the error:"NinjaTrader.Indicator.PivotPoint is a 'type' but is used as a variable."

I looked at VOL() which works this way, but I couldn't see any difference in my script that would make it different.
adamus is offline  
Old 07-28-2010, 04:39 AM   #8
adamus
Senior Member
 
Join Date: Apr 2010
Posts: 1,058
Thanks: 33
Thanked 2 times in 1 post
Default

OK I forgot I added some parameters that have to go in the constructor. Strange that the compilation error doesn't talk about constructors though.

And now it doesn't throw the error.

Thanks for the help.
adamus is offline  
Old 09-16-2010, 04:30 AM   #9
J_o_s
Senior Member
 
Join Date: Aug 2008
Location: Netherlands
Posts: 159
Thanks: 17
Thanked 5 times in 5 posts
Default

When I try to add an indicator to an strategy (by clicking on the "Indicators" button in the GUI), I get an somewhat strange error stating:
Quote:
You cannot add/change/remove an indicator until your prior request has completed loading historical data.
What does this error message mean? I'm not connected to an data provider (so the historical data is already downloaded), and the NinjaTrader Control Center doesn't shows an loading bar, or an error in the log.

Any thoughts about this would be very welcome,


EDIT: I've just been able to replicate this error:
(Not sure if this is also a step:
0. Open a new strategy analyzer window,)
1. Create a new strategy,
2. Run a backtest with this strategy on any instrument and any time frame.
3. Go to the "Chart"-tab and click on the "Indicators" button. In my case, this still works at this stage.
5. Click again on "Run Backtest" with the same settings/parameters.
6. Navigate back to the "Chart" tab, and click on "Indicators". In my case, this results in the above mentioned error message.

Does anyone know of a workaround for this, because it's quite convenient to set Default values.

Regards,
Attached Images
File Type: png error_strategy.png (91.2 KB, 10 views)
Last edited by J_o_s; 09-16-2010 at 06:35 AM. Reason: Added steps how to replicate this error
J_o_s is offline  
Old 09-16-2010, 08:25 AM   #10
NinjaTrader_Tim
NinjaTrader Customer Service
 
NinjaTrader_Tim's Avatar
 
Join Date: Nov 2009
Location: Denver, CO
Posts: 1,424
Thanks: 0
Thanked 3 times in 3 posts
Default

Hi J_o_s,

Try briefly selecting another instrument between your steps #5 and #6, from the left side list. Then switch back and try to add an indicator.
NinjaTrader_Tim is offline  
Old 11-25-2010, 03:05 PM   #11
e-man
Senior Member
 
Join Date: Dec 2008
Location: http://coroin.com
Posts: 156
Thanks: 8
Thanked 7 times in 7 posts
Default

i am adding an indicator to a strategy ... same as the original issue for this thread ... best i can tell:

1) when i instantiate an object [eg. myIndy = new MyIndy(_myVar1, _myVar2); ], it compiles, but then produces the "IndicatorBase.InputInitialize" and "barsArray[0] == null" errors;

2) when i remove the "new", i am unable to compile as i get the "is a 'type' but is used like a 'variable'" error.

any insights? it would be great to know why we shouldn't instantiate an object. i thought that was the standard/preferred way of doing things. /scratches_head

cheers,
-e
e-man is offline  
Old 11-26-2010, 05:55 AM   #12
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
Default

e-man, as Tim already mentioned this way of adding is not supported officially - the recommended way is layed out here - http://www.ninjatrader.com/support/f...ead.php?t=3228
NinjaTrader_Bertrand is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to abort Strategy Execution aascotty General Programming 1 05-02-2010 06:53 AM
Adding an Indicator inside a strategy astrolobe Version 7 Beta General Questions & Bug Reports 1 02-09-2010 08:14 AM
Adding Indicator to Strategy Litter@live.com Strategy Development 10 07-23-2009 04:01 AM
Adding Indicator Color Lines to Strategy duck_CA Strategy Development 2 02-21-2009 09:14 PM
Adding Indicator to Strategy not working ATI user Strategy Development 12 12-18-2008 01:49 PM


All times are GMT -6. The time now is 11:28 PM.