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 > Strategy Analyzer

Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer.

Reply
 
Thread Tools Display Modes
Old 08-18-2012, 11:50 AM   #1
jTramm
Junior Member
 
Join Date: Aug 2012
Posts: 7
Thanks: 2
Thanked 0 times in 0 posts
Default Import Custom Indicator for a signal

Hi everybody, im new here so bear with me:

I have a strategy that uses two indicators:
IndicatorA: my own custom daily value N indicator, that signals buy when it reaches a certain numeric level. This is a daily data series that i have in csv format
IndicatorB: standard macd crossover which i know how to program in ninja

Question: How can i import the IndicatorA data (its daily only) and how can i include it in the strategy

Thanks for your time,
jTramm is offline  
Reply With Quote
Old 08-18-2012, 12:41 PM   #2
marcow
Senior Member
 
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
Default

maybe this thread will provide some info on importing the CSV data:
http://www.ninjatrader.com/support/f...ght=csv+import

Once imported you should programm your strategy to use this data.
Do you use the strategyWizard to create your strategy ?
marcow is offline  
Reply With Quote
Old 08-18-2012, 02:57 PM   #3
jTramm
Junior Member
 
Join Date: Aug 2012
Posts: 7
Thanks: 2
Thanked 0 times in 0 posts
Default

Thanks for the swift reply,
Yes i use strategy wizard, i hope its possible to manage the custom data within that, if not ill probably would need some extra help.

Heres a sample of IndicatorA dataset:
http://i.minus.com/1345334162/kbCURY...icator.xls.zip
jTramm is offline  
Reply With Quote
Old 08-18-2012, 05:30 PM   #4
marcow
Senior Member
 
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
Default

unfortunately this is not possible from the strategy wizard.You'll have to do some serious coding using the C# StreamReader. see
http://www.ninjatrader.com/support/f...ead.php?t=3476
http://www.ninjatrader.com/support/f...t=StreamReader

You first have to create an indicator to read-in the daily data from your CSV file and put it in a dataseries. Then you create a strategy which is using this indicator.

Since you haven't got experience in C# coding (I assume, excuse me if I'm wrong) I think our best option would be to skip the whole CSV file readout part, and recreate the values of the CSV file in the NT strategy itself. Where do the values in the CVS come from ? How are they calculated ?

Marco
marcow is offline  
Reply With Quote
The following user says thank you to marcow for this post:
Old 08-19-2012, 02:00 PM   #5
jTramm
Junior Member
 
Join Date: Aug 2012
Posts: 7
Thanks: 2
Thanked 0 times in 0 posts
Default

Thats makes sense since the indicator has only a few buy signals year - how would you go about recreating the values in the NT strategy ?

Thanks
jTramm is offline  
Reply With Quote
Old 08-19-2012, 02:22 PM   #6
marcow
Senior Member
 
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
Default

What i mean is that your indicator probably does some internal calculations before outputting a value each day. What exactly are these calculations ? Or do you create these values manually ?
marcow is offline  
Reply With Quote
The following user says thank you to marcow for this post:
Old 08-20-2012, 02:12 AM   #7
jTramm
Junior Member
 
Join Date: Aug 2012
Posts: 7
Thanks: 2
Thanked 0 times in 0 posts
Default

The values are already pre calculated from out prop. software, so theres no additional calculation necessary.
Basically i have two columns:
A: Date (daily)
B: Value of the indicator (double not int.), ie. 0.86

Thanks
jTramm is offline  
Reply With Quote
Old 08-20-2012, 05:51 AM   #8
marcow
Senior Member
 
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
Default

But do you know what calculations this proprietary software makes ?
What input(s) does it have, and how does it create the output value?
marcow is offline  
Reply With Quote
Old 08-20-2012, 05:58 AM   #9
jTramm
Junior Member
 
Join Date: Aug 2012
Posts: 7
Thanks: 2
Thanked 0 times in 0 posts
Default

I know what you have in mind and it sadly does not work since we use a market internals computation that has several data inputs and that we can not recreate in NT.

The easyest way would be to somehow manually punch in the buy signals and let the backtest do the rest. Would that be possible ?
jTramm is offline  
Reply With Quote
Old 08-20-2012, 06:36 AM   #10
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
Default

JTramm, what you could consider doing as well would be creating a custom indicator for displaying the signals, where you would just manually add the dates and the signal state and then use this plot in your strategy conditions to backtest.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 08-20-2012, 06:37 AM   #11
marcow
Senior Member
 
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
Default

Quote:
I know what you have in mind and it sadly does not work since we use a market internals computation that has several data inputs and that we can not recreate in NT.
If you know the calculations and inputs that are used, you can recreate everything in NT, you''ll be amazed what can be done. And since you use the word "we" I assume you exactly know the internals of this proprietary indicator

Quote:
The easyest way would be to somehow manually punch in the buy signals and let the backtest do the rest. Would that be possible ?
That doesn't sound like a good idea to me.

I think you have 2 options on this one:
1) recreate the indicator in NT so you don't need to read the CSV file.
2) create the indicator in NT -using the C streamreader object - which reads the values from the csv-file into a dataseries.

#1 is by far the easiest solution if you can recreate the indicator in NT.

Again, if you have zero programming experience in NT - and I mean C-coding, not the strategy wizard - #2 in definitely not an option.
If you understand and can modify the code in the SampleStreamReaderNT7.zip from here http://www.ninjatrader.com/support/f...ead.php?t=3476 then you''ll be fine.Create an indicator that reads the CSV file, and use this indicator in the final strategy.

As a last resort, you also could contact a NT consultant to create the indicator that reads your csv file.


Marco
marcow is offline  
Reply With Quote
Old 08-21-2012, 06:30 AM   #12
jTramm
Junior Member
 
Join Date: Aug 2012
Posts: 7
Thanks: 2
Thanked 0 times in 0 posts
Default

Hi, Well try the first option, how can i add breadth inceces like JI5T.Z (Nas 100 net issues) to a strategy (we are Kinect paid subscribers)

Thanks so much dor the help
jTramm is offline  
Reply With Quote
Old 08-21-2012, 10:44 AM   #13
marcow
Senior Member
 
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
Default

Maybe a stupid question, but is Kinect a dataprovider ?
I suspect you'll need a seperate dataprovider like Kinetick.
I believe Kinetick supports the NAS100 net issues (JI5T.Z) instrument, does it ?
If you use additional symbols in your indicator, I advice you to first do research if the dataprovider has marketdata for each of them.

If you've got a dataprovider that is supported by NT, here's how to add your instrument, before you can use it in NT:

First step is to add the JI5T.Z instrument to NinjaTrader. To do this, open the instrument manager (Tools--> Instrument Manager) and in the "available master instruments" window click the NEW button to add a new instrument.
The instrument editor window will open. In the first blank window (Master Instrument) fill in the exact symbol name of the instrument as it is in your dataprovider, and click OK. Selct the instrument you just created in the list, and on the bottom click the arrow that points to the left to add the newly created instrument to the default instrument list.
Connect Ninjatrader to your dataprovider, and open a chart of the JI5T.Z.

Once you've got a chart of JI5T.Z running - all the symbols you use- with the next step will be to create a strategy.

Marco
marcow is offline  
Reply With Quote
Old 08-21-2012, 12:40 PM   #14
jTramm
Junior Member
 
Join Date: Aug 2012
Posts: 7
Thanks: 2
Thanked 0 times in 0 posts
Default

Hi, the provider is Kinetick, sorry for the typo(s).
What i meant was how can i apply for example a breadth indicator like ADD (Nyse advande/decline issues) to a strategy so that the buy signals would come from ADD but would be applied to another instrument ie. SPY. Basically how can i use one price stream as an "indicator" to be used in a strategy thats applied to another instrument. Thanks
jTramm is offline  
Reply With Quote
Old 08-21-2012, 02:13 PM   #15
marcow
Senior Member
 
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
Thumbs up

In that case you would run the strategy on a SPY chart (SPY is the primary dataseries) , and add the ADD instrument as a secondary dataseries.
Then programm the strategy so that it checks if for example ADD crosses above a certain level (0.5), and if so, EnterLong on the primary dataseries SPY.
I'm not familiar with the ADD and if your indicatorA makes additional calculations on this, but for clarity in this example I assume the ADD ranges from 0 to 1.

So assuming the chart your strategy is running on is 1Min SPY

in the initialize section of the code you add a 1day ADD series
Code:
Add("ADD", PeriodType.Day, 1);
in the OnBarUpdate section of the code you then add something like :

Code:
 
if (BarsInProgress == 0)
{
  if ( Closes[1][0] > 0.5 )   // mark the [1][0], this refers to the close of the secondary dataseries
   EnterLong();                 // Submits a buy market order for SPY 
}
Basicly this says: When a new bar is completed on the primary dataseries (1min SPY) check if the latest value of the secondary dataseries in this strategy -which is daily ADD - is higher then 0.5. If it is, enter a long position on the SPI.


please take a very good look at http://www.ninjatrader.com/support/helpGuides/nt7/index.html?multi_time_frame__instruments.htm
and make sure you fully understand what is explained here.

By the way, did you succeed in creating charts in NinjaTrader with all the symbols (ADD, JI5T.Z ) your IndicatorA uses ?


Marco
Last edited by marcow; 08-21-2012 at 02:16 PM.
marcow is offline  
Reply With Quote
Reply

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
Import my own .dll library for custom NinjaScript zooinek Strategy Development 7 01-10-2011 10:59 AM
custom indicators import subterfuge Miscellaneous Support 2 09-24-2010 07:36 AM
Attempt to import a custom indicator failed... kevinh786 Indicator Development 1 05-30-2010 01:43 AM
Asking for tips on custom data import jamesaq Version 7 Beta General Questions & Bug Reports 5 03-10-2010 05:18 AM
Can't import custom indicators T2020 Indicator Development 4 08-07-2008 08:03 AM


All times are GMT -6. The time now is 09:21 PM.