![]() |
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 Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jan 2012
Location: Texas
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
Hello. I am new to NT and trading in general. I have taken a few weeks to acclimatize myself with the NT environment, but I am needing a little nudge if it is at all possible. I have created a strategy. I am using the free Kinetic EOD data and want to backtest my strategy. I will try to simplify the idea here: when the current days high is less than yesterdays high, and the current days low is less than yesterdays low, and yesterdays high is less than the 2 days ago high, and yesterdays low is less than the 2 days ago low, enter a short stop order when the price gets above todays high. It should stop out when it gets below yesterdays low. This is what my conditions and actions look like thus far:
High[0]>High[1] Low[0]>Low[1] High[1]<High[2] Low[1]<Low[2] EnterShortStop(1,Low[1],"TestEntry") I connect to the Kinetic EOD before starting. When backtesting, I set type to Day, Value 1, From 9/1/2011 to 1/26/2012 (today), leaving the rest of the values at default. I find several problems: 1) I am not sure how to tell it to enter above todays High. 2) When I back test this against 4 months worth of data, I never get more than 1 entry (which is incorrect), though I see that the conditions are met many times during that period and it doesn't exit (stop) until today's date. I will apologize in advancefor my ignorance, and thank you in advance for any help and/or guidance. - Jim |
|
|
|
|
|
#2 | |
|
Senior Member
|
Quote:
|
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jan 2012
Location: Texas
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
Oh, I thought the second parameter (stop price - in this case "Low[1]") in the EnterShortStop would be the "exit". Btw, I am using the Strategy wizard. I am also actually a c# programmer by trade (one of the reasons I liked NT vs other packages), so if I have to edit the code, that will be fine. Again, forgive my ignorance if this sounds stupid.
- Jim |
|
|
|
|
|
#4 | |
|
Senior Member
|
Quote:
There are various methods for exiting trades. ExitShort(), SetStopLoss(), SetTrailStop(), and many others. Look them up in the documentation. ref: http://www.ninjatrader.com/support/h...er_methods.htm |
|
|
|
|
|
The following user says thank you to koganam for this post: |
|
|
|
#5 |
|
Junior Member
Join Date: Jan 2012
Location: Texas
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
That helped. I am getting more trades now, but the entries and exits still don't seem right. I'll keep plodding away and come back if I get completely stuck.
Thanks! - Jim |
|
|
|
![]() |
| Tags |
| backtesting, data, historical, kinetic, strategy |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| calculate yield from interest rate future | zweistein | Indicator Development | 8 | 06-04-2011 04:53 AM |
| Backtesting with Bid Ask entries? | kenb2004 | Strategy Development | 9 | 01-03-2011 05:16 AM |
| NT 7 Backtesting: How to Backtest Short and Long futures entries on Same Day | ChiTrader2000 | Version 7 Beta General Questions & Bug Reports | 5 | 11-29-2010 08:32 AM |
| Simple strategy yield no result (Even SampleMACrossOver) | kw123 | Version 7 Beta General Questions & Bug Reports | 0 | 12-21-2009 12:32 PM |
| Entries: 1 Bar Slower when backtesting | samuelg | Strategy Development | 2 | 04-13-2008 07:01 PM |