PDA

View Full Version : Back Testing Strategy - Drawings Don't Show


Ranger
06-21-2008, 09:44 PM
I created the most simple initial strategy using Keltner and some signals. Here's the guts of the code developed strictly using Edit Strategy(no personal programming). You can clearly see that once the Keltner Channels are breached, we need a Drawing(shape)....no luck on the back test chart or when employed in a chart. Any ideas???

// Condition set 1
if (CrossBelow(Close, KeltnerChannel(1.5, 10).Lower, 1))
{
DrawTriangleUp("My triangle up" + CurrentBar, false, 0, 0, Color.Lime);
}
// Condition set 2
if (CrossAbove(Close, KeltnerChannel(1.5, 10).Upper, 1))
{
DrawArrowUp("My up arrow" + CurrentBar, false, 0, 0, Color.Red);

NinjaTrader_Josh
06-21-2008, 10:21 PM
Debug via print functions to see at which bars the code believes it should be drawing on. Then go back and visit those exact bars to see what is going on. Also you may need to play with the DrawOnPricePanel property.

Ranger
06-21-2008, 10:57 PM
Hi Josh - I don't want to get into sophisticated programming; I'm just a trader albiet and engineer :o). I did some additional analysis. None of the common drawing shapes show-up such as: Arrows; squares; etc. I did get vertical lines to appear when using the bollinger band excursions based on Close. So unless there's a simple environmental variable controlling the appearance of these Shapes...I'm dead in the water. I want to get reliable signals using the program free strategy wizard...

Ranger
06-21-2008, 11:18 PM
NT - Kindly take a quick look and see if you can sort this. Also, the trade strategy is very liberal(almost silly), I'm only getting a few trades although round trips set to 300

NinjaTrader_Josh
06-21-2008, 11:32 PM
I fully understand that you may not want to deal with programming. You may want to try contacting one of the NinjaScript Consultants here to get the work done for you: http://www.ninjatrader.com/webnew/partners_onlinetrading_NinjaScript.htm

Due to bandwidth issues we do not generally review strategies case by case. I did take a quick look at your strategy though. I do not see any oddness in its coding. It should behave exactly as it is programmed to do.

jpbaldwin
03-12-2009, 09:42 AM
I created the most simple initial strategy using Keltner and some signals. Here's the guts of the code developed strictly using Edit Strategy(no personal programming). You can clearly see that once the Keltner Channels are breached, we need a Drawing(shape)....no luck on the back test chart or when employed in a chart. Any ideas???

// Condition set 1
if (CrossBelow(Close, KeltnerChannel(1.5, 10).Lower, 1))
{
DrawTriangleUp("My triangle up" + CurrentBar, false, 0, 0, Color.Lime);
}
// Condition set 2
if (CrossAbove(Close, KeltnerChannel(1.5, 10).Upper, 1))
{
DrawArrowUp("My up arrow" + CurrentBar, false, 0, 0, Color.Red);



You'll find you cant see them because they are lined up on the candles. Adding the variable to offset the drawn image will put arrow below for a buy and above for a sell. I added a simple example below based on your code (Obviously they are both displaced to the lower side as they are UP signals)

// Condition set 1
if (CrossBelow(Close, KeltnerChannel(1.5, 10).Lower, 1))
{
DrawTriangleUp("My triangle up" + CurrentBar, false, 0, Low[0] - 4 * TickSize, Color.Lime);
}
// Condition set 2
if (CrossAbove(Close, KeltnerChannel(1.5, 10).Upper, 1))
{
DrawArrowUp("My up arrow" + CurrentBar, false, 0, Low[0] - 4 * TickSize, Color.Red);

jpbaldwin
03-12-2009, 10:08 AM
NT - Kindly take a quick look and see if you can sort this. Also, the trade strategy is very liberal(almost silly), I'm only getting a few trades although round trips set to 300

I checked the code and with a Bollinger running 14,2 i didn't get a hit on a 5 min ES chart in over 20 days.

Firstly you have this problem
High[0] > High[1] + 5 * TickSize)
It should be
High[0] > High[1] - 5 * TickSize)

Even with that fixed i had to lower the std dev on the Bollinger to 1 to get any triggers

As for the condition 2 it is doing as it is told and you have many more exit points than entry hence the over abundance of red vertical lines.

I gave the file a bit of a work over, hopefully it'll help

Jase