Common code re-use - NinjaTrader Programming | futures io social day trading
futures io futures trading


Common code re-use
Updated: Views / Replies:3,480 / 12
Created: by LostTrader 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
 

Common code re-use

  #11 (permalink)
trading my rent money
Tokyo, Japan
 
Futures Experience: Intermediate
Platform: NT7
Favorite Futures: GC
 
pengi's Avatar
 
Posts: 35 since Jan 2011
Thanks: 26 given, 40 received


LostTrader View Post
If anyone has examples of C# common code re-use that they would liketo share, or more techniques that can be implemented in a NinjaScript cs file, please chime in!

Just put all your generic strategy code in a class derived from the strategy class:

 
Code
public class PengiBase : Strategy
Then make individual strategies that inherit from this new base class. Since your base class inherits from the Strategy class, they are also Strategy objects and can call all the Strategy methods like Print() etc.

 
Code
public class PengiES : PengiBase

Reply With Quote
 
  #12 (permalink)
Elite Member
Denver, CO
 
Futures Experience: Advanced
Platform: SierraChart
Broker/Data: Optimus, Rithmic
Favorite Futures: ES
 
Posts: 67 since Sep 2011
Thanks: 6 given, 32 received

If you have methods that are small and multi-purpose, you can put them in the UserDefinedMethods indicator/strategy and have access to them in each respective namespace without having a bunch of other files with static classes everywhere.

Reply With Quote
 
  #13 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Mirus/Zen
Favorite Futures: Futures - bonds, currencies, index
 
Posts: 288 since Oct 2010
Thanks: 70 given, 267 received


I have a mixture of utility procs in the user defined methods (I created my own - udm) and just used the namespace strategy and partial class strategy. I also have a load of extra classes that do bigger jobs, and I do indeed pass in the strategy to each one so I can use all the strategy methods.

Reply With Quote
The following user says Thank You to Xeno for this post:

Reply



futures io > > > > > Common code re-use

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Protecting code sam028 NinjaTrader Programming 30 April 21st, 2016 01:01 PM
Help with paintbar code. bfreefalling NinjaTrader Programming 2 April 28th, 2011 10:54 AM
Can someone code this ? skyfly NinjaTrader Programming 8 April 25th, 2011 01:40 PM
Obama’s Twist of BP’s Arm Stirs Common Tactic Debate Quick Summary News and Current Events 2 June 18th, 2010 10:39 AM
Having some issues with this code. Please help. kaywai NinjaTrader Programming 3 March 4th, 2010 11:33 AM


All times are GMT -4. The time now is 12:31 PM.

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-12 in 0.08 seconds with 19 queries on phoenix via your IP 54.145.16.43