![]() |
|
|||||||
| Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jan 2012
Posts: 13
Thanks: 1
Thanked 0 times in 0 posts
|
This was an issue that was previously posted (http://www.ninjatrader.com/support/f...ad.php?t=37527)
When I try to run backtests through the strategy analyzer (even with the premade samples) it returns no results and gets stuck on: start date 4/13/2006 end date 4/13/2006 no matter what start/end dates I select. Now when I open a separate chart and run it through the right click menu it works fine. It also seems to completely ignore stop loss or profit targets. The last question I have is: if I am in the strategies menu from right clicking on a separate chart and under order properties I select account size of X and I select by account size under "set order quantity" shouldn't it use the maximum number of contracts it can buy based off the current account balance? Thank you. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Hello, what data provider / broker would you be using here? What timeframe are you testing on in the Strategy Analyzer?
How are the stop loss and profit targets coded in? Please note that for a percentage based target for example 0.01 would equal 1 percent. For the order qty question, it would also be important to check which margin you've setup under Tools > Instrument Manager for the product you're trading.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Hello, what data provider / broker would you be using here? What timeframe are you testing on in the Strategy Analyzer?
How are the stop loss and profit targets coded in? Please note that for a percentage based target for example 0.01 would equal 1 percent. For the order qty question, it would also be important to check which margin you've setup under Tools > Instrument Manager for the product you're trading.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Jan 2012
Posts: 13
Thanks: 1
Thanked 0 times in 0 posts
|
Kinetick free EOD
Time-frame: Daily stop loss/profit: in the edit strategy window I click add, select stop loss then: from entry signal: "Long Entry" #this is the name of my long entry mode: percent #doesn't seem to matter what I select with this value: .01 #clearly messes something up because without it I have a max drawdown of ~30% and with it the max drawdown is more than 70% simulated: true #or false, has no effect The margin box is greyed out. |
|
|
|
|
|
#5 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
The simulated option would not be available in backtesting, it would play a part only if the strategy was traded realtime (is the stoploss submitted so other could see it, or would it be locally held?).
Would you mind attaching the strategy here or sending it to support at ninjatrader dot com so we could give a quick run for you? Which instrument(s) are you trading here? Stocks?
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Jan 2012
Posts: 13
Thanks: 1
Thanked 0 times in 0 posts
|
at this point I don't really care if the stop is held local/submitted. I'm trying to learn the interface with something basic.
The strategy is attached as a .txt let me know if you need a different file type. Instruments: This morning I tried everything. Ideally I want to be able to back test on indexes in addition to stock/futures. also I'm having trouble downloading historical daily (sometimes) and intraday (always) regardless of the data feed. I tried to use ToS data feed through TD and that gave me a couple of different errors. When I use continuous contracts it doesn't do anything. Is there any easy way to convert a csv file to your format? I have some data but the year is in the wrong place and there is an extra data field. edit: also when I try to import data why does it force me to use "stock" instead of futures (so I could set a multiplier) or index, even when the exchange is set to globex?
Last edited by stuck; 01-25-2012 at 09:06 AM.
|
|
|
|
|
|
#7 | |||
|
NinjaTrader Customer Service
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
|
Stuck
I am happy to assist you on behalf of Bertrand. As far as your strategy is concerned, I can get it to work. Please keep in mind testing on a daily time frame may only enter very few trades. Please increase the date ranges you are using and test again. Quote:
Quote:
Here is an example of NT format : 20120118 140000;1.2803;100000 Quote:
Please let me know if I may assist further.
Adam P.
NinjaTrader Customer Service |
|||
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Jan 2012
Posts: 13
Thanks: 1
Thanked 0 times in 0 posts
|
If this is relevant I'm using the 64 bit version of the latest version of NT. I have tried everything that I have listed on this thread in the 32 bit version.
I'm using a large date range (50yrs) and it still does not work. I use historical data manager to import the data. That set is formatted correctly. Another problem is when I try to edit data set information through instrument manager I can't change instrument type, margin value, point value: these are greyed out. When I try to edit other settings that I can access and hit ok it tells me to select an extra exchange besides default. When I do this and click ok I see the ok button do the click response but nothing happens. The window will only close if I hit cancel. After I do this sometimes it can't get EOD data from kinetick. I then have to restart NT. NT also refuses to load any bars for a chart when I select the uploaded data set. As far as NT supporting other time formats, it doesn't. It only supports one format but it will adjust timestamps of that format for different time zones as selected. This seems like an obtuse design when supporting multiple time formats is a pretty standard feature and easily supported by most languages... I have some experience with debugging and I know that often it is a user error. I'm trying to find what I'm doing wrong but I have spent 6 hours on this today and can't figure it out. I looked at the help guide and nothing from that has helped. I have also restarted my computer and re installed NT if that is helpful. As for the backtest all I can tell you is with the exact same code that I gave you it refuses to run on my computer. ![]() ![]()
|
|
|
|
|
|
#9 | |||
|
NinjaTrader Customer Service
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
|
Stuck,
Quote:
Your going to have to convert the file into NinjaTrader format. Basically you will need to set the file name to something like this : $EURUSD.Last.txt. You can alternatively use Metastock format. Quote:
Quote:
Adam P.
NinjaTrader Customer Service |
|||
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Jan 2012
Posts: 13
Thanks: 1
Thanked 0 times in 0 posts
|
how do I create a new instrument that links back to a local file for the data?
ok I got it to run the back test in the strategy analyzer but it is stuck with 1 contract. I set the account size to 100000, margin value is 0 and point value is 1 for the item I used to backtest. There is also a problem with the data from 1970 to the end of 1977, 6/21/1978 to 7/26/1983 (there are a few random bars in between with open != close. The open and close are always the same. This is through kinetick EOD. Also the stop loss is still failing. What was the max loss on a trade when you ran it? |
|
|
|
|
|
#11 | ||||
|
NinjaTrader Customer Service
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
|
stuck,
Quote:
So this file would like to the Last data for $EURUSD instrument. Quote:
Quote:
Quote:
Please let me know if I may assist further.
Adam P.
NinjaTrader Customer Service
Last edited by NinjaTrader_AdamP; 01-25-2012 at 03:10 PM.
|
||||
|
|
|
|
|
#12 |
|
Junior Member
Join Date: Jan 2012
Posts: 13
Thanks: 1
Thanked 0 times in 0 posts
|
What I'm saying is that isn't what is happening.
I upload the file, it says everything worked. (file name is test.Last.txt if the $ sign is in front I get an error) I go to edit in historical data manager to make sure the data is there, it is. then file->new->chart select test make sure times match (day data to days) then I get error on loading chart data for "test Default": failed to retrieve data from (any of the data services available) then I go to tools-> instrument manager select test from the list click edit try to edit any of the data and hit "ok" ERROR you must assign an exchange in addition to the 'Default' exchange select one at random because the instrument ISN'T listed. click ok the ok button responds but nothing happens. The instrument editor window remains open. now I X that out because it is useless. back on the instrument manager window click new ???????????????????? (don't know what to do) enter test.Last.txt as master instrument select default try to hit ok WARNING YOU MUST SET A LEAST ONE 'SYMBOL MAP' VALUE ??? It is a local file... not on a website C+P the directory of the file into External try to load, same error. entries per direction is set to more than one (it is 100000 right now to make sure) still uses only 1 contract should have adequate capital defined if the calculation for number of contracts =capital/facevalueofcontract "This can be expected if there are after hours trading." Frankly that doesn't make sense unless there is a bug in the data. I have data that doesn't do that and includes AH which is part of the reason I would like to be able to import local data sets. Stop loss was fixed after copying the original, deleting that strategy, and pasting into a new strategy. |
|
|
|
|
|
#13 |
|
NinjaTrader Customer Service
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
|
stuck,
Thanks for your note. Could you possibly post this data? What instrument are you attempting to load back to 1970? A symbol map needs to be set, you can just set the symbol name in the "Kinetick" section in the "Misc" tab. After this you should be able to save the new instrument. As far as your strategy running with only 1 order, please check the "Order Properties" section in the Strategy properties, ensure that "Default quantity" is set to the proper number. I look forward to helping you resolve your issue.
Adam P.
NinjaTrader Customer Service |
|
|
|
|
|
#14 |
|
Junior Member
Join Date: Jan 2012
Posts: 13
Thanks: 1
Thanked 0 times in 0 posts
|
I would prefer not to post it on the forum but I can probably PM it.
Maybe we can arrange something... INDU The problem with default order quantity is that I want it to take a full clip all the time. There isn't a setting for this as far as I know. It would also be useful to have functions so you could scale into positions properly. |
|
|
|
|
|
#15 |
|
NinjaTrader Customer Service
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
|
stuck,
All this is possible in NinjaScript, it just takes some extra coding steps. Here is a link to reference samples for advanced coding of strategies : http://www.ninjatrader.com/support/f...splay.php?f=30 You can send an email to Support at NinjaTrader dot com with "ATTN : Adam Ticket : 598502" in the message body or subject. We can work together privately this way. Please let me know if I may assist further.
Adam P.
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_AdamP for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Strategy Analyzer not running when clicking 'Backtest' | adamus | Strategy Analyzer | 4 | 03-08-2011 08:20 AM |
| Obtaining Begin/End Date in Strategy Analyzer | bobcat70 | Strategy Development | 1 | 08-02-2010 07:06 AM |
| Compiling a Strategy resets backtest properties in Analyzer | adamus | Version 7 Beta General Questions & Bug Reports | 4 | 05-08-2010 04:56 PM |
| Date column in Strategy Analyzer - Periods tab | adamus | Version 7 Beta General Questions & Bug Reports | 4 | 04-19-2010 11:23 AM |
| In strategy analyzer backtest, trades stopped | anothertoy | Strategy Analyzer | 17 | 05-26-2009 08:24 AM |