![]() |
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
|
|||||||
| Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Aug 2012
Posts: 7
Thanks: 2
Thanked 0 times in 0 posts
|
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, |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
|
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 ? |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Aug 2012
Posts: 7
Thanks: 2
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
|
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 |
|
|
|
|
The following user says thank you to marcow for this post: |
|
|
|
#5 |
|
Junior Member
Join Date: Aug 2012
Posts: 7
Thanks: 2
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
|
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 ?
|
|
|
|
|
The following user says thank you to marcow for this post: |
|
|
|
#7 |
|
Junior Member
Join Date: Aug 2012
Posts: 7
Thanks: 2
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
|
But do you know what calculations this proprietary software makes ?
What input(s) does it have, and how does it create the output value? |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Aug 2012
Posts: 7
Thanks: 2
Thanked 0 times in 0 posts
|
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 ? |
|
|
|
|
|
#10 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
|
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.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#11 | ||
|
Senior Member
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
|
Quote:
![]() Quote:
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 |
||
|
|
|
|
|
#12 |
|
Junior Member
Join Date: Aug 2012
Posts: 7
Thanks: 2
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#13 |
|
Senior Member
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
|
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 |
|
|
|
|
|
#14 |
|
Junior Member
Join Date: Aug 2012
Posts: 7
Thanks: 2
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#15 |
|
Senior Member
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
|
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);
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
}
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.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |