![]() |
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: May 2009
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
|
I am a new user of the NT. It is really an amazing software. I am trying to make some sample backtesting, I've spent hours trying to get the Strategy Wizard's functions do what I want Please help me out with this:
I want to enter long when these conditions are present: 20EMA above 50EMA and open&close of the candle (full body) is in within the range of 20EMA and 50EMA, enter long one tick above the high. Obviously my logic is not what of the Strategy Wizard, this is what I put what seems as logic to me: Conditions: EMA(20)[1]>EMA(50)[1] Close[1]>=EMA(50)[1] Open[1]>=EMA(50)[1] Close[1]<=EMA(20)[1] Open[1]<=EMA(20)[1] I also tried to use separate Sets for each, nothing seems to work ![]() Do following: Enter long position In words the idea is the fast ema must be above slow ema, price then must come to the range between fast and slow ema's whole candle must form within this range. Enter long next bar one tick above. I'll appreciate any help. Thank you.
Last edited by SNIP07; 05-09-2009 at 11:47 AM.
|
|
|
|
|
|
#2 | |
|
Certified NinjaScript Consultant
|
Quote:
|
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: May 2009
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
|
|
|
|
|
|
|
#4 |
|
Certified NinjaScript Consultant
|
try changing all [1] to [0]
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: May 2009
Posts: 20
Thanks: 0
Thanked 0 times in 0 posts
|
|
|
|
|
|
|
#6 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Debugging is always the frustrating part of any type of logic development. Here are some tips -
- Strip down your strategy a single condition 20 MA > 50 MA - For your action, just color the bar or draw some sort of chart marker on the bar when this condition evaluates to true - Throw this strategy on a chart (backtest), inspect the chart, are the markers where you expect them - Add the next line, Close < 50 MA etc... - Repeat this process until it no longer delivers against your expectations, then you know where your logic issue is
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Strategy Wizard Question | 123r34 | Strategy Development | 3 | 02-23-2010 05:33 AM |
| Strategy Wizard Question | PraiseOne | Strategy Development | 12 | 03-25-2009 06:42 AM |
| Strategy Wizard Question | PraiseOne | NinjaScript File Sharing Discussion | 0 | 03-23-2009 05:33 PM |
| Strategy Wizard Question | 123r34 | Strategy Development | 4 | 02-24-2009 05:00 PM |
| Strategy Wizard Question | RSTLNE | Strategy Development | 4 | 09-03-2008 08:12 AM |