NexusFi: Find Your Edge


Home Menu

 





Sample Advanced Automated Strategy v1.0


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one dsraider with 36 posts (41 thanks)
    2. looks_two wgreenie with 21 posts (1 thanks)
    3. looks_3 gg80108 with 11 posts (6 thanks)
    4. looks_4 Ducman with 7 posts (0 thanks)
      Best Posters
    1. looks_one MXASJ with 3 thanks per post
    2. looks_two dsraider with 1.1 thanks per post
    3. looks_3 cbritton with 0.7 thanks per post
    4. looks_4 gg80108 with 0.5 thanks per post
    1. trending_up 49,803 views
    2. thumb_up 64 thanks given
    3. group 27 followers
    1. forum 117 posts
    2. attach_file 15 attachments




 
Search this Thread

Sample Advanced Automated Strategy v1.0

  #51 (permalink)
stockdisk
toronto,ontario
 
Posts: 15 since Nov 2009
Thanks Given: 6
Thanks Received: 33

yes ,thanks for your quick reply,i have live paid on my desktop will try there ,thanks again for quick reply

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
REcommedations for programming help
Sierra Chart
Cheap historycal L1 data for stocks
Stocks and ETFs
ZombieSqueeze
Platforms and Indicators
 
  #52 (permalink)
dsraider
New York, NY
 
Posts: 142 since Dec 2009
Thanks Given: 41
Thanks Received: 87

Okay, let me know if it works?

Reply With Quote
  #53 (permalink)
 gg80108 
Castle Pines N, CO.
 
Experience: Advanced
Platform: NinjaTrader
Broker: Amp Futures/Zen-Fire)
Trading: ES
Posts: 201 since Jul 2009
Thanks Given: 196
Thanks Received: 132



dsraider View Post
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

SampleAdvancedAutomatedStratv1.1

UPDATE:
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

I have been working on a similar strategy and came across in NT help something about using OnExecution to drive a strategy based on fills rather then OnOrderUpdate,,https://www.ninjatrader-support.com/HelpGuideV6/helpguide.html
Any opinion on this?
Don

Reply With Quote
  #54 (permalink)
precisetrader
United States
 
Posts: 5 since Feb 2010
Thanks Given: 1
Thanks Received: 2

It looks interesting, I will make it a try and let you know how it works for, me, thanks for sharing

Reply With Quote
  #55 (permalink)
 jgreene 
Palm City, Fl
 
Experience: Beginner
Platform: Ninja
Broker: NinjaTrader Brokerage
Trading: Futures
Posts: 23 since Mar 2010
Thanks Given: 5
Thanks Received: 5

I must be missing something. I downloaded [SIZE=2][COLOR=#0066cc]Sample Advanced Automated Strategy v1.0[/COLOR][/SIZE] on my Desktop and imported it to Ninja. I opened an ES 5 minute chart, invoked the strategy and nothing happened. I played with different time setttings and different instruments but no go. I use Ninja 6.something and not 7

Any suggestions. BTW, thanks for all the work.

Jack Greene

Reply With Quote
  #56 (permalink)
 zikonc 
san ramon
 
Experience: Beginner
Platform: ninja
Broker: zen
Trading: es, 6e
Posts: 136 since Oct 2009
Thanks Given: 98
Thanks Received: 76

I am not sure what you are expecting to happen but maybe this will help.....you have "if (Historical) return;" condition, ......

https://www.ninjatrader-support.com/HelpGuideV6/helpguide.html

and search for Historical.........

Reply With Quote
  #57 (permalink)
 jgreene 
Palm City, Fl
 
Experience: Beginner
Platform: Ninja
Broker: NinjaTrader Brokerage
Trading: Futures
Posts: 23 since Mar 2010
Thanks Given: 5
Thanks Received: 5

If I understand a strategy, one must first open a chart and set the instrument you want to trade, then the timeframe and then number of days back and this will creat the chart.

Once the chart is created, I open the strategy section, select the strategy, hit new and then either apply or OK.

Am I doing this correctly or is their something I am missing?

Thanks

Reply With Quote
  #58 (permalink)
 gg80108 
Castle Pines N, CO.
 
Experience: Advanced
Platform: NinjaTrader
Broker: Amp Futures/Zen-Fire)
Trading: ES
Posts: 201 since Jul 2009
Thanks Given: 196
Thanks Received: 132

Looks like NT support knows there stuff,, the “0” is the printout of getting the entry price.. Does 3 or 4 gyrations before the entry price shows up.. By then the it wont take any stop orders..

The next printout uses the execution method, and the price shows up right away..

Attached Files
Elite Membership required to download: iexecution.txt
Reply With Quote
  #59 (permalink)
dsraider
New York, NY
 
Posts: 142 since Dec 2009
Thanks Given: 41
Thanks Received: 87

jgreene,

What you're doing sounds right. Maybe post a screen shot of the chart with the strategy window up? I made this thing in 6.5 so that shouldn't be the issue.

Dave

Reply With Quote
  #60 (permalink)
 jgreene 
Palm City, Fl
 
Experience: Beginner
Platform: Ninja
Broker: NinjaTrader Brokerage
Trading: Futures
Posts: 23 since Mar 2010
Thanks Given: 5
Thanks Received: 5



dsraider View Post
jgreene,

What you're doing sounds right. Maybe post a screen shot of the chart with the strategy window up? I made this thing in 6.5 so that shouldn't be the issue.

Dave

Dave,

Thanks so much for your post. I can not seem to be able to copy and paste so I have attached a .jpg file.

Jack

Attached Thumbnails
Click image for larger version

Name:	Dave_6B_Strat.jpg
Views:	278
Size:	194.4 KB
ID:	10984  
Reply With Quote




Last Updated on November 16, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts