Advanced Strategy Writing - NinjaTrader Programming | futures io social day trading
futures io futures trading


Advanced Strategy Writing
Updated: Views / Replies:3,131 / 8
Created: by zeller4 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
 

Advanced Strategy Writing

  #1 (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

Advanced Strategy Writing

Hello all,

I've been reading (and re-reading) the sections in the NT support helpguide in the Advance Event Driven Programming Section. ie: http://www.ninjatrader-support.com/HelpGuideV6/helpguide.html?OnExecution

Does anyone have a comprehensive sample strategy that you could share which incorporates the various functions:

IOrder
IExecution
IPosition
OnOrderUpdate

Here's a snippet from the NT website which tells me I need to understand the use of these advanced functions together:
Quoting 

/*CRITICAL: If you want to drive your strategy logic based on order fills
you must use OnExecution() instead of OnOrderUpdate().
OnExecution() is always triggered after OnOrderUpdate().
There is internal strategy logic that is triggered after
OnOrderUpdate() is called but before OnExecution()
that can adversely affect your strategy if you are relying on
tracking fills within OnOrderUpdate(). */

The samples on the NT fileshare are the "Lite" version which typically only include the small sample of the syntax with the tie-in to the OnBarUpdate main section. Finding the "Needle In The Haystack" of how orders flow in one file is what i'm hoping someone will share. I understand there is an order flow with priorities of the internal workings of NT that are not revealed.

Any help or reference you can provide is much appreciated.

Regards,
Kirk

Reply With Quote
 
  #2 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received

I definitely wouldn't seek advice from myself in this matter, but have you checked some sample strategies here at futures.io (formerly BMT)?:

https://futures.io/free_downloads/ninjatrader/strategies/15-download.html?view

If I remember it correctly they include OnOrderUpdate and OnPositionUpdate but they are not really well commented (and most of the comments are in Italian anyway)

Good luck and if you would find anything helpful please post!

Reply With Quote
 
  #3 (permalink)
Elite Member
New York
 
Futures Experience: Advanced
Platform: NT
 
gabga100's Avatar
 
Posts: 147 since Nov 2009
Thanks: 44 given, 69 received


Hey let me know if this helps ....

#region Variables
private IOrder myLongorder = null;
private IOrder myShortorder = null;

#endregion


protected override void OnExecution(IExecution execution) //
{
//oderhandling(IOrder order);



if (execution.MarketPosition == MarketPosition.Long )
{

CancelOrder(myAskorder);
}

else
{

CancelOrder(myBidorder);
}



}

Reply With Quote
 
  #4 (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

thanks gregid,
all of those files (from the Italian connection!) had some good script on IPosition and one had an IOrder section -i'll check them out further... I did a quick market replay and didn't have any orders placed so I'm not sure how to get some results to verify....

The other thing that makes me wonder is if IExecution were added to any of these files, what would be the manner to tie them all together???

Any other leads or assistance is greatly appreciated.
kz

Reply With Quote
 
  #5 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received

Hi Kirk

Were you able to find any other sample strategies with IOrders? I still struggle trying to making these work as I need them.

Reply With Quote
 
  #6 (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

Hi gregid,

Not yet - nothing new with IOrder....

I've been working with a trailing stop strat that actually moves the trailing stop with a visual marker and now i'm trying to emulate the breakeven feature of ATMs.

hope to be able to share more soon.

kz

Reply With Quote
The following user says Thank You to zeller4 for this post:
 
  #7 (permalink)
Elite Member
lexinton, sc
 
Futures Experience: Intermediate
Platform: ninjatrader
Broker/Data: mirus/zen-fire
Favorite Futures: ES
 
Posts: 5 since Oct 2009
Thanks: 4 given, 3 received

Hello, interested in trailing stop in ninja strategy... i have been struggling with it for awhile, is there a way to set a trailing stop that adjusts with an indicator, say parabolicSAR +/- 1 tick on ES. I can't seem to get trailing stop to reset after the first order is executed. Also, you mentioned a visual way to see trailing stop, where or how do you track a trailing stop while order is running? I looked at ninja support/help but just don't get it, not a programmer, just trying to simulate/test my strategy performance.
thanks

Reply With Quote
 
  #8 (permalink)
 Vendor: www.traderwerks.com 
Taipei Taiwan
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Optimus
Favorite Futures: TW
 
Posts: 693 since Jun 2009
Thanks: 440 given, 440 received

IOrder, IExecution, IPosition, OnOrderUpdate

These are all great for advanced risk management. Just work through the examples, and it will get pretty easy.

I have written crazy risk management stuff using the advanced features so there is a lot of flexibility there.

Reply With Quote
 
  #9 (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


traderwerks View Post
IOrder, IExecution, IPosition, OnOrderUpdate

These are all great for advanced risk management. Just work through the examples, and it will get pretty easy.

I have written crazy risk management stuff using the advanced features so there is a lot of flexibility there.

Thanks traderwerks

If I remember right, you're a programmer from Chicago??? . I spoke to you about a project last year....

I guess the thing that would eliminate the confusion for me is if a template including all four of these in basic form is available. for example, is the sequence critical? Do I need to use return statements within the different functions? Does OnBarUpdate include only a couple lines with the bulk of the code going in the other I...xyz functions?
thanks for any basic format you could offer.
Kirk


Last edited by zeller4; December 28th, 2009 at 12:38 AM.
Reply With Quote

Reply



futures io > > > > > Advanced Strategy Writing

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
VIDEO TUTORIAL: How to create an advanced NinjaTrader Strategy Big Mike NinjaTrader 63 November 6th, 2016 03:25 PM
Sample Advanced Automated Strategy v1.0 dsraider NinjaTrader Programming 117 November 16th, 2011 02:57 PM
Need help with writing a strategy for NT Eagle01 NinjaTrader Programming 1 October 20th, 2010 10:38 AM
VIDEO TUTORIAL: How to create an advanced NinjaTrader Strategy Big Mike NinjaTrader Programming 0 January 26th, 2010 06:22 AM
Need help writing a simple strategy soumi71 The Elite Circle 4 November 17th, 2009 01:05 PM


All times are GMT -4. The time now is 04:56 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-13 in 0.13 seconds with 19 queries on phoenix via your IP 54.90.92.204