QuickFIX "layer" for Ninja? - NinjaTrader Programming | futures io social day trading
futures io futures trading


QuickFIX "layer" for Ninja?
Updated: Views / Replies:2,655 / 11
Created: by heech 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
 

QuickFIX "layer" for Ninja?

  #1 (permalink)
Just starting out...
CA
 
Futures Experience: None
Platform: NinjaTrader w/ Vision
 
Posts: 4 since Jun 2009
Thanks: 0 given, 1 received

QuickFIX "layer" for Ninja?

Hi all,

My strategy has been slowly evolving, and now I have about 7000 lines of code running in Ninja. (Actual trading logic is probably only 1000-2000 lines... a lot of other performance tracking, logging stuff in the background.)

I like Ninja's data handling, and I like using Ninja for backtesting.

The one thing I really don't like, is being "stuck" to Ninja's order handling. It means I'm stuck to Ninja's small set of broker adapters. I'm also looking to implement options trading, which isn't supported within Ninja.

So, I've been looking into converting over into QuickFIX. The obvious solution would be to build a class which basically implements all of Ninja's order functions (EnterLong(), ExitLong()), and order events (OnOrderUpdate(), OnExecution())... using QuickFIX.

I just didn't want to duplicate anyone else's work, if it's already been done. Any previous experience out there?

Thanks in advance!

Reply With Quote
The following user says Thank You to heech for this post:
 
  #2 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received

sorry I can't help you on the technicals, but congratulations on your work!

Are you getting a good P/L? Have you run into anly problems with autotrading in NT?

Reply With Quote
 
  #3 (permalink)
Just starting out...
CA
 
Futures Experience: None
Platform: NinjaTrader w/ Vision
 
Posts: 4 since Jun 2009
Thanks: 0 given, 1 received



Saroj View Post
sorry I can't help you on the technicals, but congratulations on your work!

Are you getting a good P/L? Have you run into anly problems with autotrading in NT?

Stay tuned! I've had ups and downs, but am slowly making fundamental improvements (like selecting better instruments to focus on). Since June, I've had 4 consecutive up months (but did have some intra-month drawdown)... talk to me in 20 years, and I'll let you know how I did.

As far as autotrading, it's usually working very well. But to make this work I'm tracking all of my positions independent of Ninja... I have my own Order objects, track my own fills, etc, etc. Now, I basically leave Ninja with my strategy running 6 days a week, 24 hours a day. I shut it all down Friday night, reboot my machine, and then relaunch Sunday afternoon.

That said, there's at least one latent bug that I haven't been able to resolve... when I have two different strategies placing orders on the same instrument at almost exactly the same time (same bar), I believe there's a race condition in Ninja 6.5. The *quantity* of the orders may become wrong... I believe the quantity requested by the second order call some how overrides the quantity requested by my code in the first call. It's pretty hard to replicate, but I've seen the bug 3 times in the last month, so I'm pretty sure it's real. I'm just hoping Ninja 7 gets rid of it.

Reply With Quote
 
  #4 (permalink)
Elite Member
Austin, TX
 
Futures Experience: Advanced
Platform: NT/Matlab
Broker/Data: Interactive Brokers
Favorite Futures: FX majors
 
sefstrat's Avatar
 
Posts: 285 since Jun 2009
Thanks: 20 given, 749 received

Just curious why you would have two strategies running on the same instrument?

Why not merge all the logic into one strategy handling multiple orders?

Reply With Quote
 
  #5 (permalink)
Just starting out...
CA
 
Futures Experience: None
Platform: NinjaTrader w/ Vision
 
Posts: 4 since Jun 2009
Thanks: 0 given, 1 received


sefstrat View Post
Just curious why you would have two strategies running on the same instrument?

Why not merge all the logic into one strategy handling multiple orders?

Only because I potentially have long and short positions of the same instrument... and EnterLong() and EnterShort() can't co-exist in the same strategy at the same time. Learned that the hard way.

So I have one strategy that only goes short, and another that goes long.

On NT7, this all gets easier when I don't use Ninja's order handling rules.

Reply With Quote
 
  #6 (permalink)
Elite Member
Austin, TX
 
Futures Experience: Advanced
Platform: NT/Matlab
Broker/Data: Interactive Brokers
Favorite Futures: FX majors
 
sefstrat's Avatar
 
Posts: 285 since Jun 2009
Thanks: 20 given, 749 received

Why would you want to have long and short positions of the same instrument? Isn't that a waste of commissions?

Reply With Quote
 
  #7 (permalink)
Just starting out...
CA
 
Futures Experience: None
Platform: NinjaTrader w/ Vision
 
Posts: 4 since Jun 2009
Thanks: 0 given, 1 received


sefstrat View Post
Why would you want to have long and short positions of the same instrument? Isn't that a waste of commissions?

The "why" should be pretty obvious. I mean, it's strategy specific, so I won't get into it in too much detail... but I'll just say, it's profitable to have both.

The alternative way of implementing this (and it would save commissions) is putting another layer on top of the Ninja order code, and some how "sum up" the short/long orders to come up with some kind of a net position... and then place orders accordingly. That might work, but it really complicates the logic for what I'm doing in terms of tracking individual positions/fills. I prefer to think of these as independent positions, even though they're on top of the same instrument.

Reply With Quote
 
  #8 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received

I suppose you could have two instances of NT running on different computers each with a different strategy... you might have to pay for two licenses, but that's a nit if you've got a good strategy.

Reply With Quote
 
  #9 (permalink)
 Vendor: www.tradingstudies.com 
Denver, CO
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: TF, ES, CL
 
roonius's Avatar
 
Posts: 132 since Jun 2009
Thanks: 20 given, 272 received


heech View Post
Only because I potentially have long and short positions of the same instrument... and EnterLong() and EnterShort() can't co-exist in the same strategy at the same time. Learned that the hard way.

So I have one strategy that only goes short, and another that goes long.

On NT7, this all gets easier when I don't use Ninja's order handling rules.

NT 7 will allow to have both positions.
Holding long and short positions at the same time is possible using SubmitOrder, ChangeOrder and CancelOrder methods.

I don't know how "buggy" it is at the moment, but I like the ability. "Internal order handling rules" were big pain in the neck and somewhere else.

Reply With Quote
 
  #10 (permalink)
Elite Member
Seattle, WA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Interactive Brokers/IQFeed
Favorite Futures: Stocks
 
Posts: 27 since Nov 2009
Thanks: 10 given, 66 received


With a simple strategy (i.e. sell if some oscillator > 80, buy if < 20) there can be no disagreement between the long & short sides so you can easily put both in one strategy.

If things are more complex, and it's possible for both the long and short sides to want to be in a position at the same time, it can make more sense to separate the strategies for a couple of reasons.

1) It's simpler to code and test the long and short strategies separately. If both strategies want to have positions, logically it makes sense to be flat, and wait until only one strategy holds a position. This is exactly what you get if your platform allows you to be long and short at the same time, and it doesn't cost extra in commissions unless both strategies fire at the same time (i.e. closing positions at the end of the day). Total system performance is simply the sum of the long & short system performances.

2) The resulting system can be much more stable. If you put both long & short sides in a single strategy and let one "win" (i.e. whichever triggers first will block the other), then small variations in inputs can cause large variations in performance. In that case, total system performance is unpredictable and is certainly NOT the sum of the long & short system performances.

-Kevin

Reply With Quote

Reply



futures io > > > > > QuickFIX "layer" for Ninja?

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
RodS ZN trades using Sharkys "power of 7" DMA paint RodS Trading Journals 23 May 29th, 2011 02:36 PM
dealing with GetCurrentBidVolume and GetCurrentAskVolume , "long" casting into "int" jmejedi NinjaTrader Programming 4 May 23rd, 2011 10:33 AM
RJay's "Trader Volume" and "Trader Tick" Indicator Suites RJay The Elite Circle 20 December 20th, 2010 06:01 PM
"HiLo of time range" indicator - for Ninja 6.5 ? Eric j NinjaTrader 9 October 5th, 2010 08:14 AM
"time"stop" codes for MC ptcm EasyLanguage Programming 1 September 2nd, 2010 01:57 AM


All times are GMT -4. The time now is 07:58 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-15 in 0.12 seconds with 19 queries on phoenix via your IP 54.234.247.118