Is NT fast enough to autotrade small timeframes? - NinjaTrader Programming | futures io social day trading
futures io futures trading


Is NT fast enough to autotrade small timeframes?
Updated: Views / Replies:3,740 / 22
Created: by David 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
 

Is NT fast enough to autotrade small timeframes?

  #1 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 88 since Jun 2009
Thanks: 35 given, 84 received

Is NT fast enough to autotrade small timeframes?

I'm testing an autotrading strategy that trades CL on 4 range bars.

So far today, the strat has twice encountered the dreaded "sell or stop limit orders can't be placed above the market" condition. That triggers a rejected order and shuts the strat down, as I've not yet coded in rejection handling routines.

I am using NT 7 beta 22, Kinetick data feed and the system was running in Sim mode so it wasn't even connected to a broker API.

I write well optimised code as I have been a pro software developer for years, but I'm starting to wonder if NT is inherently fast enough to cope when a fast moving instrument like CL hits the gas pedal, when using short time frames.

Any thoughts?

Thanks
David

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

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


David,

I'm going through the same thing using Unmanaged = true. Please don't quit-with your experience, you should be able to improve on code I'm using to handle these rejections.

Right now, I'm using this in Initialize:
 
Code

RealtimeErrorHandling = RealtimeErrorHandling.TakeNoAction;

(I haven't noticed if this really helps or not)

and this in OnExecution
 
Code

if (entryOrder_1a != null && entryOrder_1a == order)
{ 
// Reset the entryOrder object to null if order was cancelled without any fill
if (order.OrderState == OrderState.Cancelled && order.Filled == 0 ||
order.OrderState == OrderState.Rejected && order.Filled == 0
)
{
entryOrder_1a = null;
}
}
Obviously, the order entry section needs to address where price is with respect to your entry stop or limit. I had to test numerous times with chart trader to make sure I understood which one needs to happen below the current price and which is above.
 
Code

if (longEntryPrice > 0 && Close[0] < longEntryPrice)
{
barState = 2;//need buy stoplimit
barNumberOfOrder = CurrentBar;
//NOT STOP OR LIMIT
entryOrder_1a = SubmitOrder(0, OrderAction.Buy, OrderType.StopLimit, contractQty_1, limitprice, stopprice, "Entry_1a", "LongEntry_a2");
else
{
barState = 3;//need limit
barNumberOfOrder = CurrentBar;
//NOT STOPLIMIT OR STOP
longEntryOrder_1a = SubmitOrder(0, OrderAction.Buy, OrderType.Limit, contractQty_1, limitPriceL, stopPriceL, "Entry_1a", "LongEntry_a3");
// 

So far this seems to help with only the barstate=2 section. Haven't fully tested the barstate= 3 part yet.
Good luck.
Kirk

Reply With Quote
The following 4 users say Thank You to zeller4 for this post:
 
  #4 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 88 since Jun 2009
Thanks: 35 given, 84 received

Hi Kirk

Many thanks for the unmanaged code samples. I do actually use unmanaged orders at the moment, though I haven't added code to handle order rejections yet.

I think the issue is that my strat is multi time frame so this seems to slow down its performance, which becomes a problem when CL starts a rapid price movement - by the time the strat places the order for the target price, the market has moved beyond it.

I use COBC = true to try and speed things up.

As my SL is 4 ticks and PT is 8 ticks on a 4 range chart, the system seems too slow to handle it. I don't know if a shorter time frame for the mtf anchor would speed up performance or not.

Any suggestions are more than welcome

Reply With Quote
 
  #5 (permalink)
Elite Member
Las Vegas, Nevada
 
Futures Experience: None
Platform: MultiCharts
 
Posts: 44 since Apr 2010
Thanks: 12 given, 12 received

If you have programming experience and you have a system that really works, you can code it to use your broker's API directly and bypass Ninja. Even if you convert your strategy to unmanaged code, you have no idea what else Ninja is doing with your CPU.

Reply With Quote
The following 2 users say Thank You to Crow for this post:
 
  #6 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 88 since Jun 2009
Thanks: 35 given, 84 received


Quoting 
you can code it to use your broker's API directly and bypass Ninja

Interesting idea, thanks Crow. I didn't want to reinvent any wheels, hence using NT for its mtf and inbuilt connectivity and order handling capabilities but I'm starting to wonder if it is just adding another layer of latencies.

I see that you use Java. A friend builds HFT systems in Java with direct connectivity to the exchange APIs running on Linux boxes, and gets stunning performance. Have you got any recommendations for Java libraries?

My broker is Interactive Brokers so they have a great API to exploit.

Thanks

David

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

David,

You and Crow are in the stratosphere compared to my experience for the API and network setups.

I would think you'd want to check how to set it up as COBC=false if the momentum is high and your stops aren't too tight.

The only other thing I could add would be to test OnMarketData which give OHLCV values differently than OnBarUpdate.

I'm doing a test now and hope to have some results by next week.

HTH,

Kirk

Reply With Quote
The following user says Thank You to zeller4 for this post:
 
  #8 (permalink)
Membership Revoked
United States of America
 
Futures Experience: Advanced
Platform: NT
 
Posts: 1,149 since Aug 2009
Thanks: 262 given, 471 received


David View Post
Hi Kirk

Many thanks for the unmanaged code samples. I do actually use unmanaged orders at the moment, though I haven't added code to handle order rejections yet.

I think the issue is that my strat is multi time frame so this seems to slow down its performance, which becomes a problem when CL starts a rapid price movement - by the time the strat places the order for the target price, the market has moved beyond it.

I use COBC = true to try and speed things up.

As my SL is 4 ticks and PT is 8 ticks on a 4 range chart, the system seems too slow to handle it. I don't know if a shorter time frame for the mtf anchor would speed up performance or not.

Any suggestions are more than welcome

The sad truth is NT isn't fast enough in CL, FDAX or TF. You can try a dedicated server close to the exchange to improve latency and/or adding buffer ticks to the strat. Consider the slippage the price of getting a fill.

Reply With Quote
The following user says Thank You to Zoethecus for this post:
 
  #9 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 88 since Jun 2009
Thanks: 35 given, 84 received


Quoting 
You and Crow are in the stratosphere compared to my experience for the API and network setups.

I'm not so sure about that (I can't speak for Crow, of course). I've been looking at the strat you're working on which looks very promising, not so sure about the entry criteria though


Quoting 
I would think you'd want to check how to set it up as COBC=false if the momentum is high and your stops aren't too tight.

Yep, makes sense, but with multiple time frames, I think that COBC=false would bog the system down even more.

I really don't want to resort to custom programming a trading system from the ground up unless I really have to so I'm thinking of ways to use just one time frame, but the strat is only profitable when it uses a higher time frame anchor at the moment.

I think CL jumps over some prices occasionally when momentum is boosted, which makes good control of order rejections vital. You are also competing with some very low latency systems which makes autotrading it even more challenging.

If I get it working with NT I'm going to host it on a dedicated server in a Chicago datacentre to try and reduce network latencies as much as possible.

David

Reply With Quote
The following user says Thank You to David for this post:
 
  #10 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 88 since Jun 2009
Thanks: 35 given, 84 received



Quoting 
The sad truth is NT isn't fast enough in CL, FDAX or TF. You can try a dedicated server close to the exchange to improve latency and/or adding buffer ticks to the strat. Consider the slippage the price of getting a fill.

Hi Zoe, our replies crossed. It makes you think about trading an easier instrument, but the volatility of CL and the daily profit potential is enormous and maybe worth the challenge assuming that a solution can be found.

Have you traded Aardvark in a live or papertrade environment yet?


Quoting 
Consider the slippage the price of getting a fill.

The only way I can get good fills is by placing limit orders well ahead of the current price action, which is why I am using MTFs, particularly with an 8 tick profit target where market orders would kill the profit.

David

Reply With Quote

Reply



futures io > > > > > Is NT fast enough to autotrade small timeframes?

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
Multichart autotrade Serger Elite EasyLanguage Automated Trading 3 July 21st, 2011 01:16 PM
Timeframes for Trading 6E traderjcf The Elite Circle 8 June 30th, 2011 01:22 AM
highlighting timeframes? madLyfe NinjaTrader 7 June 28th, 2011 08:44 PM
Autotrade with IB mosheobrien Reviews of Brokers and Data Feeds 9 April 9th, 2011 06:26 PM


All times are GMT -4. The time now is 09:51 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.14 seconds with 19 queries on phoenix via your IP 54.221.93.187