Strategy + indicator coding - samples / examples - NinjaTrader Programming | futures io social day trading
futures io futures trading


Strategy + indicator coding - samples / examples
Updated: Views / Replies:11,991 / 19
Created: by max-td Attachments:1

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
 1  
 
Thread Tools Search this Thread
 

Strategy + indicator coding - samples / examples

  #1 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

Strategy + indicator coding - samples / examples

hi all,
here is a source with lots of examples how to get to several solutions in indicator + strategy-coding :

Reference Samples - NinjaTrader Support Forum

hope that helps!

max-td
Reply With Quote
The following user says Thank You to max-td for this post:
 
  #2 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

here some snippets for

StopLoss
ProfitTarget
TrailStop

in strategys

 
Code
                            
    protected override void Initialize()

        {
            
// Submit stop-loss and profit target orders


            
SetStopLoss(CalculationMode.Ticks5);

            
SetProfitTarget(CalculationMode.Ticks10);

           
SetTrailStop(CalculationMode.Ticks40);
            
            
CalculateOnBarClose true;
            

        } 

http://www.ninjatrader-support.com/HelpGuideV6/helpguide.html?SetProfitTarget

http://www.ninjatrader-support.com/HelpGuideV6/helpguide.html?SetTrailStop

http://www.ninjatrader-support.com/HelpGuideV6/helpguide.html?SetStopLoss


Attention :
The SetTrailStop() method can NOT be used concurrently with the SetStopLoss() method for the same position, if both methods are called for the same position (fromEntrySignal) the SetStopLoss() will always take precedence. You can however, use both methods in the same strategy if they reference different signal names.

max-td

Last edited by max-td; November 30th, 2009 at 09:13 AM.
Reply With Quote
The following 3 users say Thank You to max-td for this post:
 
  #3 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received


Also, especialy for beginners, i recommend the NinjaTrader- online-events
to do the first steps into creating strategys with the NT-wizard :

Automated Strategy Developement :

What:
Software Training Session
When: Usually once per week
Online Trading. NINJATRADER. Online events.
Duration: Approximately 60 mins
Cost: Free to everyone
Develop your strategy concept, construct it, historically test it, optimize it, simulation test it and then live deploy it through your live brokerage account with NinjaTrader’s strategy development tools. This session is designed to provide a high-level overview of the following areas:
  • Create a strategy in the Strategy Wizard
  • Create entry and exit conditions and invoke actions
  • Backtest using the Strategy Analyzer
  • Understand the backtest results
Plan to attend this session if you want to maximize your efficiency in utilizing NinjaTrader for automated strategy development. After completing the Automated Strategy Development Level I training session, you will:
  • Know the process for constructing a strategy using the Strategy Wizard
  • Know how to create entry and exit conditions
  • Know how to backtest a strategy
  • Know how to view the performance results of a backtested strategy
Participation is free so please attend if you are a first-time visitor, new user or an existing user. These sessions are always informative and keep you up-to-date on any enhancements and features we add to our strategy development features.


Online Trading. NINJATRADER. Online events.

and then start through

max-td
Reply With Quote
The following user says Thank You to max-td for this post:
 
  #4 (permalink)
Elite Member
Sydney, NS
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen-Fire
Favorite Futures: TF,S,GC
 
cclsys's Avatar
 
Posts: 607 since Nov 2009
Thanks: 248 given, 379 received

Max, do you (or anyone else) have a sample strategy that doesn't use fixed tick trailing stops?

Also, how do you keep track of profit/loss within the strategy to perhaps change nr. of contracts, ratio of profit-to-loss etc.?

Also, does anyone have a good example of a multiple entry and exit strategy?

I must confess I have been stumped/frustrated by the brevity and simplicity of the examples provided and also the lack of shared strategies anywhere just to have a basic template with most of the above (and other) options to key off of. If you don't know C+ coding, the error messages are very hard to figure out so I have tended to stay away. But now I want to use strategies to test key ideas even if I don't particularly want to run them for generating income. Working only in indicators is too complicated at this point and really doesn't work for testing purposes.

Reply With Quote
 
  #5 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

sorry cclsys, i dont have such stuff.
but if there are other folks out there - feel welcome to post + collect advanced strategy-snippets here also !

max-td
Reply With Quote
 
  #6 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

Here are some videos showing how to start to learn programming / programming a strategy in NT for beginners / learners :

Created by Camtasia Studio 3

Created by Camtasia Studio 3

max-td
Reply With Quote
The following user says Thank You to max-td for this post:
 
  #7 (permalink)
Elite Member
Concord, NH USA
 
Futures Experience: Intermediate
Platform: Ninja trader
Broker/Data: AMP/CQG
Favorite Futures: ES
 
jdella's Avatar
 
Posts: 182 since Jun 2009
Thanks: 134 given, 110 received

Thanks Max, those videos made it look easy . Can the same be done to create indicators?

Reply With Quote
 
  #8 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

with this condition-stuff that is not possible in the indicator-wizard.
the indi-wizard is more about plotting lines + such things - the visualizations.

max-td
Reply With Quote
 
  #9 (permalink)
Elite Member
Sydney, NS
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen-Fire
Favorite Futures: TF,S,GC
 
cclsys's Avatar
 
Posts: 607 since Nov 2009
Thanks: 248 given, 379 received


max-td View Post
Here are some videos showing how to start to learn programming / programming a strategy in NT for beginners / learners :

Created by Camtasia Studio 3

Created by Camtasia Studio 3

Yup, can't wait for high speed. Right now, videos are out of my league!

Reply With Quote
 
  #10 (permalink)
Elite Member
Dublin, Ireland.
 
Futures Experience: Advanced
Platform: NinjaTrader, TOS, Multicharts, Open Source various
Favorite Futures: FDAX, cable/yen, FX, options on commodities
 
mrticks's Avatar
 
Posts: 67 since Jun 2009
Thanks: 16 given, 9 received



max-td View Post
here some snippets for

StopLoss
ProfitTarget
TrailStop

in strategys

 
Code
                            
    protected override void Initialize()

        {
            
// Submit stop-loss and profit target orders


            
SetStopLoss(CalculationMode.Ticks5);

            
SetProfitTarget(CalculationMode.Ticks10);

           
SetTrailStop(CalculationMode.Ticks40);
            
            
CalculateOnBarClose true;
            

        } 
http://www.ninjatrader-support.com/HelpGuideV6/helpguide.html?SetProfitTarget

http://www.ninjatrader-support.com/HelpGuideV6/helpguide.html?SetTrailStop

http://www.ninjatrader-support.com/HelpGuideV6/helpguide.html?SetStopLoss

Hi max-td,

Is it possible to use all three in the same strategy? I have put stopLoss, trailStop and profitTarget in some strategies but when I backtest the trail stop doesn't take effect. When I check the entries and exits on the chart it looks like the stop loss is taking effect but the profit target and trail stop are ignored. Does that make sense to you? I'll post my code later on if you'd like to take a look?

Reply With Quote

Reply



futures io > > > > > Strategy + indicator coding - samples / examples

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

Dec 7

Linda Bradford Raschke: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Some coding help adding PnL display to strategy grego The Elite Circle 5 March 23rd, 2012 02:12 PM
Strategy Coding Challenge MWinfrey NinjaTrader Programming 4 January 25th, 2011 06:12 PM
Strategy coding - Would Anyone please take a quick look at........ mdsvtr NinjaTrader Programming 4 November 5th, 2010 06:54 AM
Strategy Wizard Coding Question njaisson NinjaTrader Programming 8 October 6th, 2010 08:34 AM
Help Coding Trailing stoploss in Strategy Darshiit NinjaTrader Programming 3 June 25th, 2010 10:45 AM


All times are GMT -4. The time now is 09:48 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-11-23 in 0.14 seconds with 20 queries on phoenix via your IP 54.198.221.13