NexusFi: Find Your Edge


Home Menu

 





Latency in Easylanguage


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one kevinkdog with 2 posts (2 thanks)
    2. looks_two martingjesus with 2 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 ABCTG with 1 posts (2 thanks)
    1. trending_up 1,854 views
    2. thumb_up 4 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

Latency in Easylanguage

  #1 (permalink)
 
martingjesus's Avatar
 martingjesus 
Madrid Spain
 
Experience: Master
Platform: Multicharts, Tradestation
Broker: Tradestation, InteractiveBrokers
Trading: Stocks
Posts: 15 since Sep 2015
Thanks Given: 10
Thanks Received: 5

Hi, I have been researching a lot about this subject and finally have arrived to the conclusion that with this two sentences for instance:

Buy next bar at market;

Buy next bar at ... limit;

There is a latency not simple to see. One would expect to buy at market or to place the limit order in the moment the strategy generates the order, however "Next Bar" implies that for the strategy to send the order to the broker the next bar that we are trying to buy has to be formed with at least one tick. In higly liquid markets this could be a bunch of milliseconds but in other not so liquid it could be perfectly 1 min. I have realised that in some cases my order gets filled two bars after the order should theoretically be sent.

I'll appreciate some comments on this, and if someone would know how to send the order in the instant that the last bar close, not waiting for a new tick in the next bar, or if this could be fixed in other platforms. Thanks.

Follow me on Twitter Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Cheap historycal L1 data for stocks
Stocks and ETFs
What broker to use for trading palladium futures
Commodities
 
  #3 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,666 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,360



martingjesus View Post
Hi, I have been researching a lot about this subject and finally have arrived to the conclusion that with this two sentences for instance:

Buy next bar at market;

Buy next bar at ... limit;

There is a latency not simple to see. One would expect to buy at market or to place the limit order in the moment the strategy generates the order, however "Next Bar" implies that for the strategy to send the order to the broker the next bar that we are trying to buy has to be formed with at least one tick. In higly liquid markets this could be a bunch of milliseconds but in other not so liquid it could be perfectly 1 min. I have realised that in some cases my order gets filled two bars after the order should theoretically be sent.

I'll appreciate some comments on this, and if someone would know how to send the order in the instant that the last bar close, not waiting for a new tick in the next bar, or if this could be fixed in other platforms. Thanks.

Did you try "buy this bar at close;" ??

Follow me on Twitter Reply With Quote
Thanked by:
  #4 (permalink)
 
martingjesus's Avatar
 martingjesus 
Madrid Spain
 
Experience: Master
Platform: Multicharts, Tradestation
Broker: Tradestation, InteractiveBrokers
Trading: Stocks
Posts: 15 since Sep 2015
Thanks Given: 10
Thanks Received: 5

I think that should work with market orders, but with limit orders?

Follow me on Twitter Started this thread Reply With Quote
  #5 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,666 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,360


martingjesus View Post
I think that should work with market orders, but with limit orders?

Right, it won't work with limit orders.

One thing to consider is that Tradestation (or any commercial software, possibly) might not be the right tool for what you are wanting to do.

For example, I'd never attempt to use TS for a scalping type strategy.

Follow me on Twitter Reply With Quote
Thanked by:
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

martingjesus,

Multicharts and Tradestation for that matter are event driven, meaning the code gets executed only when there is an event triggering it - in general that would be a new tick arriving.
You can look into using timers to forcefully recalculate your code and send orders even when there is no new tick arriving. The one "limitation" for that is that is, it only works in realtime.

Regards,
ABCTG

Follow me on Twitter Reply With Quote
Thanked by:




Last Updated on September 26, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts