NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript File Sharing > NinjaScript File Sharing Discussion

NinjaScript File Sharing Discussion Discussion for shared NinjaScript files.

Reply
 
Thread Tools Display Modes
Old 12-03-2008, 10:33 PM   #1
ctrlbrk
Senior Member
 
Join Date: Oct 2008
Location: Dallas, TX
Posts: 682
Default SlingShot with TriggerLines

Hello,

First thank you to roonius for the SlingShot indicator and to Gumphrie for the TriggerLines indicator.

I just downloaded these indicators an hour ago but already wanted to share what I have found. I think these two indicators can be very useful.

Let me apologize in advance for my horrible chart mark-up skills, I don't know how people create great charts so I've just used the tools I know how to use without breaking out Photoshop.

I've taken a 275 tick chart on the ES for this particular example, although I played around and other time frames work as well.

SlingShot settings of 10 (fast), 80 (slow), both HMA. TriggerLines settings of 20 and 8.

If you get confirmation from both indicators, you then enter the trade. Your target is 2 points with a small stop. I use 2 points for this example because it is a very small timeframe. I think larger time frame will reward you with larger gains.

I will try to build a strategy around this, but I am having a lot of trouble with Ninja backtesting any strategy using tick level data for any useful period of time (1 year or more). I may have to revert to 1m data.







I'd love to have some feedback. One thing I will volunteer as feedback right up front is that if you take the trades only as TriggerLines indicates, and ignore SlingShot all together, the results are the same in this particular example, but I always need at least one confirmation to enter a trade.
ctrlbrk is offline  
Reply With Quote
Old 12-03-2008, 11:13 PM   #2
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Default

Keep us posted on what you come up with.

I always found TriggerLines to be a useful indicator but never incorporated it into my trading. Perhaps its time to give it another look. If I remember correctly I may have also made some 'enhancements' to Gumphrie's original, if so I'll be sure to post it.
Elliott Wave is offline  
Reply With Quote
Old 12-04-2008, 12:22 AM   #3
ctrlbrk
Senior Member
 
Join Date: Oct 2008
Location: Dallas, TX
Posts: 682
Default

Hi Elliott,

That would be appreciated. So far in a couple hours I put this together. It still needs a lot of work but I am tired and stopping work for tonight. I haven't incorporated SlingShot yet as I had problems using it in a strategy (see SlingShot thread).

I've only worked on the long side. It's using 3 minute for setup period because I had trouble with Trigger not being consistent without a higher value.

The drawdown is still too much for me, it needs better entry, but I am going to bed and will work on this later. Overall good potential though I think.



The core of the code is this for anyone not wanting to look at CS file:

if (BarsInProgress == 0 && FirstTickOfBar && Position.MarketPosition == MarketPosition.Flat && (BarsSinceExit(0, "long", 0) == -1 || BarsSinceExit(0, "long", 0) > 5))
{
if (CrossAbove(TriggerLines(20, 12).Plot1_Dn, TriggerLines(20, 12).Plot2_Dn, 1))
{ nextbarmaybe = true; }

if (nextbarmaybe && nextbarmaybect < 4)
{
nextbarmaybect++;

if ((Rising(HMA(BarsArray[1], 80)))
&& (Rising(LeaderOfMACD(12, 26, 9).Diff))
&& (StdDev(BarsArray[1], 3)[0] > 1))
//&& (Rising(HMA(10))))


{
if ((ToTime(Time[0]) <= 93000 || ToTime(Time[0]) >= 140000)) return;

EnterLong(DefaultQuantity, "long");
SetProfitTarget("long", CalculationMode.Price, (Close[0] + (ATR(BarsArray[1], 3)[0] / 1)));
SetStopLoss("long", CalculationMode.Price, (Close[0] - (ATR(BarsArray[1], 3)[0] / 2)), false);
nextbarmaybe = false;
nextbarmaybect = 0;
}
}
else
{
nextbarmaybe = false;
nextbarmaybect = 0;
}

}
Attached Files
File Type: cs TriggerShot.cs (3.8 KB, 93 views)

Last edited by ctrlbrk; 12-04-2008 at 12:37 AM.
ctrlbrk is offline  
Reply With Quote
Old 12-05-2008, 12:50 PM   #4
altrader
Member
 
Join Date: Mar 2008
Posts: 49
Default

Quote:
Originally Posted by ctrlbrk View Post
Let me apologize in advance for my horrible chart mark-up skills, I don't know how people create great charts so I've just used the tools I know how to use without breaking out Photoshop.
CtrlBrk, try Jing Project for image capture and chart markup. http://www.jingproject.com/

Al
altrader is offline  
Reply With Quote
Old 12-05-2008, 10:46 PM   #5
ctrlbrk
Senior Member
 
Join Date: Oct 2008
Location: Dallas, TX
Posts: 682
Default

altrader, thank you for the link.

In my next post I'll update this strategy.
ctrlbrk is offline  
Reply With Quote
Old 12-05-2008, 10:54 PM   #6
ctrlbrk
Senior Member
 
Join Date: Oct 2008
Location: Dallas, TX
Posts: 682
Default

I now made the strategy multi-time frame and added my file sharing code like I use in all my strategies to cross-communicate.

This is probably the last update for this thread. I never did incorporate SlingShot into the strategy, I just used a couple of HMA indicators here and there to do the same thing.

The strategy still needs a great deal of work, but is a good start. You will need to customize the File System parts of the strategy if you intend to use it, or delete that code altogether --- since it will use directories and files that won't exist on your system (but do on mine).

Last, I've only worked on the long side of the strategy due to time constraints on my part. The short side is in there a bit but hasn't been refined at all.

Attached Files
File Type: zip trigger_long.zip (15.8 KB, 220 views)
ctrlbrk is offline  
Reply With Quote
Old 12-06-2008, 02:37 AM   #7
J_o_s
Member
 
Join Date: Aug 2008
Location: Netherlands
Posts: 92
Default

Thanks for posting your code Ctrlbrk! It looks quite complex, and I guess I can learn a lot from dissecting the program.

Backtest results are good to, of course.
J_o_s is offline  
Reply With Quote
Old 01-16-2009, 12:12 PM   #8
pdmoney
Junior Member
 
Join Date: Jan 2009
Posts: 19
Default Great Post

can someone please explain to a newbie how I can incorporate other indicators into strategies as a confrimation to execute an order? For example, go long when the Trigger lines turn positive AND the RSI crosses above -20 then sell only if the trigger lines turn negative AND the RSI has crossed through 80.. I'm sure others new to NT have had to figure this out, without programming skills, it is possible isnt it???

Thanks guys (and gals)
pdmoney is offline  
Reply With Quote
Old 01-16-2009, 01:06 PM   #9
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 16,357
Default

pdmoney,

You will want to try out the Strategy Wizard. Please see the Help Guide tutorials on it here: http://www.ninjatrader-support.com/H...tml?Overview34
__________________
Josh, NinjaTrader Customer Service
NinjaTrader is a FREE application for advanced charting, market analytics, system development and trade simulation.

View schedule of upcoming online product training events.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-20-2009, 02:44 PM   #10
pdmoney
Junior Member
 
Join Date: Jan 2009
Posts: 19
Default Trigger Long

I get Zero trades when I backtest that strategy as is...what am I doing wrong?
pdmoney is offline  
Reply With Quote
Old 01-20-2009, 02:57 PM   #11
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 16,357
Default

Check your Control Center logs for errors. Otherwise it may be best for you to try and get into contact with the original author for help on their script.
__________________
Josh, NinjaTrader Customer Service
NinjaTrader is a FREE application for advanced charting, market analytics, system development and trade simulation.

View schedule of upcoming online product training events.
NinjaTrader_Josh is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
TriggerLines Gumphrie NinjaScript File Sharing Discussion 26 05-02-2010 10:48 AM
SlingShot roonius NinjaScript File Sharing Discussion 17 12-27-2009 09:43 AM
Slingshot indicator saschja NinjaScript File Sharing Discussion 7 12-15-2007 04:24 PM


All times are GMT -6. The time now is 12:17 PM.