People of the interweb,
With the help of several sample strategies I found on the NT forum and a little ingenuity, I have put together a fully-automated, advanced strategy which does the following:
1. Only enters between 10:15 AM and 3:15 PM (
EST) (allows for second time frame as well)
2. Shuts down if
PnL is more than $1,000 or less than -$300
3. Enters limit orders for long and short based on signal
4. Covers three time frames but will only have one active position open at a time
5. Cancels entry order if market moves four ticks away from
limit order without filling
6. Sets an initial stop at 12 ticks, then changes to
breakeven at +4 ticks and trails, tick by tick, from there
7. Scales out of half position at +4 ticks (1st profit target) and covers second half position at +8 ticks (2nd profit target)
Good news: All parameters can be changed to suit your needs. Please feel free to add to, delete or change anything in the code. All that I ask is that you don't sell my hard work for profit.
Bad news: As I have been coding C# for roughly 2.5 weeks, the contents of the strat pretty much consists of everything I know about coding. Therefore, if you want something drasticly changed, I will most likely not know how.
I am creating this thread so that we may all help to make it better, if need be, so please keep all comments and requests to this thread. As of now, the only thing with which I am not thrilled is the CancelOrder() code. It USUALLY works fine, but sometimes it surprises me. I am open to suggestions for how to make that, or any other part, better.
Click below for the strat. To install: Control Panel ---> File ---> Utilitites ---> Import Ninjascript...
Thanks and happy trading,
Dave
v.1.1 - 2/23/10
1. Fixed CancelOrder() code.
2. Added arrows and chart name plots (since plots will only show on main chart, this lets you know which time frame just took the trade).
If you cannot see your full chart name once plotted: Right-click on chart ---> Properties ---> Right Side Margin