Object-oriented design for complex NinjaTrader strategies - NinjaTrader Programming | futures io social day trading
futures io futures trading


Object-oriented design for complex NinjaTrader strategies
Updated: Views / Replies:3,339 / 5
Created: by shodson Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Object-oriented design for complex NinjaTrader strategies

  #1 (permalink)
 Vendor: www.probabletrades.com 
OC, California, USA
 
Futures Experience: Advanced
Platform: IB/TWS, NinjaTrader, thinkorswim
Favorite Futures: stocks, options, futures, VIX
 
shodson's Avatar
 
Posts: 1,860 since Jun 2009
Thanks: 480 given, 3,255 received

Object-oriented design for complex NinjaTrader strategies

Some of the strategies I develop are starting to get really complicated and long. I'd like to start modularizing my strats into separate class files, but NT doesn't seem to like that very much, every .cs has to either be a strat or an indicator. I also created a BaseStrategy class, which inherits from Ninja's strategy class, then tried to have my strats inherit from my BaseStrategy for my specific strategy sub-classes but Ninja didn't like that either. So how does one implement good OOP in Ninjatrader without creating one giant .cs file every time? The only alternative I can think of is to create an assembly (.DLL) in Visual Studio with helper methods and other re-usable functionality that my strats might want to use, like sending email, working with SQL Server, money management algorithms, etc, then reference it in Ninja and add a using statement to the DLL to bring in the outside behavior.

Any thoughts?

Reply With Quote
 
  #2 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,356 given, 83,237 received

It's a good thought Scott.

I've not tried this, but you might try the .*.NinjaScript.Utility approach, you can place some code in the napespace within the .Utility (ie: shodson.NinjaScript.Utility.cs) and call them from multiple indicators or strategies.

Then just do an include reference:
 
Code
using shodson.Utility;
At the top of your code where you want to call it.

if I understand correctly, the NinjaScript.Utility is special in this way and for this purpose. I tried to find some documentation on it just now but couldn't, so I am only citing from prior examples of code I've seen that use this approach. (Roonius and VitaminC come to mind).

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #3 (permalink)
Just starting out...
Toronto
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 1 since Oct 2009
Thanks: 6 given, 0 received


You may find this useful:

NinjaTrader Support Forum > NinjaScript Development Support > General Programming > NT as a Black Box Development System

www.ninjatrader-support2.com/vb/showthread.php?t=23275

particularly the post #6 by roonius with Visual Studio Solution sample attached:
www.ninjatrader-support2.com/vb/showthread.php?p=130983#post130983


Last edited by sam028; January 26th, 2010 at 03:41 PM. Reason: good links...
Reply With Quote
 
  #4 (permalink)
Trade with the flow
Paris, France
 
Futures Experience: Advanced
Platform: Market Delta & Ninjatrader
Favorite Futures: ES
 
cunparis's Avatar
 
Posts: 2,563 since Jun 2009
Thanks: 1,157 given, 2,032 received


Boo Doo View Post
particularly the post #6 by roonius with Visual Studio Solution sample attached:
www.ninjatrader-support2.com/vb/showthread.php?p=130983#post130983

Thanks for the link to the project. I haven't used visual studio in a long time but I'm going to download it and try to make a simple indicator with it.

Anyone else doing this?

Reply With Quote
 
  #5 (permalink)
Elite Member
Florida
 
Futures Experience: Intermediate
Platform: NT7
Favorite Futures: CL, NQ, NG
 
Posts: 456 since Jun 2009
Thanks: 1,359 given, 383 received

Hello cunparis,

Any progress with this new project?

Kirk

Reply With Quote
 
  #6 (permalink)
Trade with the flow
Paris, France
 
Futures Experience: Advanced
Platform: Market Delta & Ninjatrader
Favorite Futures: ES
 
cunparis's Avatar
 
Posts: 2,563 since Jun 2009
Thanks: 1,157 given, 2,032 received


zeller4 View Post
Hello cunparis,

Any progress with this new project?

I got a copy of visual studio but haven't installed it yet. I plan to give it a try. What I want to do is put some of my algorithms into a DLL and then make an interface for Ninjatrader, Tradestation, & other platforms.

Reply With Quote

Reply



futures io > > > > > Object-oriented design for complex NinjaTrader strategies

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Object reference not set to an instance of an object. gomad NinjaTrader Programming 11 December 22nd, 2014 09:09 AM
need help :: cant fix :: Object reference not set to an instance of an object Trader.Jon NinjaTrader Programming 9 November 3rd, 2010 11:55 AM
any ninjatrader programmers who can code simple strategies? mystiq NinjaTrader Programming 4 July 8th, 2010 10:45 AM
Object-Oriented Programming Concepts Saroj Platforms and Indicators 0 July 19th, 2009 06:20 AM
ATM Strategies - NinjaTrader zeller4 NinjaTrader 1 June 19th, 2009 06:10 PM


All times are GMT -4. The time now is 03:27 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-18 in 0.10 seconds with 19 queries on phoenix via your IP 54.163.209.109