NexusFi: Find Your Edge


Home Menu

 





VIDEO TUTORIAL: How to create an advanced NinjaTrader Strategy


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one calhawk01 with 10 posts (1 thanks)
    2. looks_two Big Mike with 9 posts (193 thanks)
    3. looks_3 stephenszpak with 6 posts (0 thanks)
    4. looks_4 spinnybobo with 6 posts (2 thanks)
      Best Posters
    1. looks_one Big Mike with 21.4 thanks per post
    2. looks_two piersh with 8 thanks per post
    3. looks_3 zeller4 with 7 thanks per post
    4. looks_4 Cloudy with 1.5 thanks per post
    1. trending_up 85,359 views
    2. thumb_up 231 thanks given
    3. group 61 followers
    1. forum 67 posts
    2. attach_file 3 attachments




 
Search this Thread

VIDEO TUTORIAL: How to create an advanced NinjaTrader Strategy

  #11 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,322 since Jun 2009
Thanks Given: 33,143
Thanks Received: 101,476


Treggs View Post
Hi Mike,

Thanks for the video Just wondering if you could explain your comments on why this particular optimization gives positive results but isn't actually profitable. I have only done a little optimization (on a different trading platform) and I'm wondering what is the point of optimization if the results can be so varied?

Would your next step be to forward test an optimized strategy to ensure it works? Just interested in your work flow.

TIA

There are a few reasons.

1) Not enough backtesting data. You need to really backtest for > 1 year, in my opinion.
2) Yes, you need to forward test in live market.
3) Simple is usually better, but in this case, the strategy is too simple to work. Efficiency is required to be profitable, and this strategy isn't very efficient in my opinion.

Still, I'm sure you could do worse

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
The following 5 users say Thank You to Big Mike for this post:

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Request for MACD with option to use different MAs for fa …
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
62 thanks
NexusFi site changelog and issues/problem reporting
48 thanks
Battlestations: Show us your trading desks!
36 thanks
GFIs1 1 DAX trade per day journal
32 thanks
What percentage per day is possible? [Poll]
31 thanks

  #12 (permalink)
 rsi77 
Chicago
 
Experience: Intermediate
Platform: Ninja Trader & TradeStation
Broker: Amp Futures/Zen-Fire
Trading: ES
Posts: 56 since Jun 2009
Thanks Given: 17
Thanks Received: 48

Mike,
Great video. I only learned C# from what I've done in NT so your little tricks will help me a lot in writing more elegant code.

By the way, what did you use for screen capture? The quality of the video is excellent.

Ron

Reply With Quote
  #13 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,322 since Jun 2009
Thanks Given: 33,143
Thanks Received: 101,476


Ron,

I used Camtasia and recorded it in HD mode (1920x1080), and have a Vimeo Plus account which supports 720p and 1080p videos.

I'll do all my future videos this way, thanks for the feedback.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #14 (permalink)
 phyzfer 
Chicago
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus/Zen-FIre
Trading: GC, ES
Posts: 73 since Mar 2010
Thanks Given: 40
Thanks Received: 33

Mike,

Great job. The video was clear, valuable and easy to understand.

Reply With Quote
  #15 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,606 since Aug 2009
Thanks Given: 11,327
Thanks Received: 2,736


zeller4 View Post
I'm hoping others wanting to provide additional help / suggestions will be able to share and develop this into an even more detailed or advanced code.

Kirk

Greetings,
I have tried to run the strategy.
As long as I run it in Simulation or Market Replay mode it works fine.

If I try to run it with a 'live' realtime feed, I get an error message.
I've attached it here.

Does anyone know what would cause this?

I think it is the exit method using more than one target?

Thanks,


 
Code
An over fill was detected on order
'Order='44af571b9b9d45c7877c78edbbb3547a/Sim101' Name='target2'
State=Filled Instrument='6E 06-10' Action=SellShort Limit price=0 
Stop price=0 Quantity=1 Strategy='BarColorChgv3' Type=Market 
Tif=Gtc Oco='-f6739cd0d9334993a2b6879bc6792c90' 
Filled=1 Fill price=1.3404 Token='44af571b9b9d45c7877c78edbbb3547a'
 Gtd='12/1/2099 12:00:00 AM'' generated by strategy
'BarColorv3/f6739cd0d9334993a2b6879bc6792c90' : This strategy will be disabled and NinjaTrader will attempt to cancel/close any strategy generated orders and positions. Please check your account orders and positions and take any appropriate action.
 
Code
Strategy 'BarColorv3/f6739cd0d9334993a2b6879bc6792c90' attempted to cancel an
 order with ID '30eb4130978e40778d70732b650955ad' however, NinjaTrader has not
 yet received cancellation confirmation from your broker. 
Please check your account orders and position and take appropriate action.

Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on Twitter Reply With Quote
  #16 (permalink)
 zeller4 
Orlando Florida
 
Experience: Intermediate
Platform: NT8
Trading: CL, NQ, ES, RTY
Posts: 477 since Jun 2009
Thanks Given: 1,416
Thanks Received: 404

I think the offending code has to do with

 
Code
BarColorv3
I don't have Ninja on at the moment to look at the code to see if that has anything to do with what I posted. Do you have a separate cs file for this?

kz

Reply With Quote
  #17 (permalink)
 stibflo 
Elverum, Norway
 
Experience: Intermediate
Platform: Multicharts, Ninja Trader
Broker: Optimus futures / Rithmic
Trading: NQ
Posts: 7 since Dec 2009
Thanks Given: 5
Thanks Received: 2

Hello

Thank you for making videos like this. For those of us that is not very experienced in making ninja strategies, it is very usefull to watch and learn. One video like that, saves me for many hours of reading. I hope you can make more of them to us.

Reply With Quote
The following user says Thank You to stibflo for this post:
  #18 (permalink)
 
spinnybobo's Avatar
 spinnybobo 
Crete, IL/USA
 
Experience: Intermediate
Platform: NinjaTrader, Mt4
Broker: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Trading: ES, CL, EUR/USD, TF
Posts: 173 since Aug 2009
Thanks Given: 105
Thanks Received: 61

Mike

thanks for posting this video. It is really great for us who are learning programming to see videos like this as there are literally none on the internet for NinjaTrader.

so thank you very much

Spencer

Follow me on Twitter Reply With Quote
  #19 (permalink)
 
LostTrader's Avatar
 LostTrader 
Tucson, AZ
 
Experience: Intermediate
Platform: Ninjatrader
Broker: Mirus/Zen-Fire
Trading: CL, TF
Posts: 74 since Sep 2009
Thanks Given: 21
Thanks Received: 64

Thank you for this video. I have no experience with strategies and have been hesitant to jump in. I found your walk-through on writing a strategy very encouraging. It seems to be one of those programming things that NT doesn't like to discuss in their videos.

Reply With Quote
The following user says Thank You to LostTrader for this post:
  #20 (permalink)
 
stephenszpak's Avatar
 stephenszpak 
Massachusetts (USA)
 
Experience: None
Platform: NinjaTrader
Trading: YM
Posts: 750 since Jun 2009
Thanks Given: 144
Thanks Received: 356


Post #6 has the download.

In the download:

private bool be2 = true;
private bool be3 = true;

In the video:

private bool be2 =false;
private bool be3 =false;

So which is correct? (Sorry if this question was already covered or I missed something here.)

I've spent some time now and then trying to understand NinjaScript. I appreciate this video greatly. There
is just no way whatsoever I could have put together this strategy. I have altered it to remove the moving
averages, which never seem to help, and added some other very basic code.
It compiles so it must work. (hee hee)

- Stephen

Reply With Quote





Last Updated on October 23, 2020


© 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