NexusFi: Find Your Edge


Home Menu

 





Outside the Box and then some....


Discussion in Trading Journals

Updated
      Top Posters
    1. looks_one iantg with 66 posts (325 thanks)
    2. looks_two SMCJB with 12 posts (15 thanks)
    3. looks_3 artemiso with 12 posts (34 thanks)
    4. looks_4 pen15 with 10 posts (2 thanks)
      Best Posters
    1. looks_one iantg with 4.9 thanks per post
    2. looks_two wldman with 3.7 thanks per post
    3. looks_3 artemiso with 2.8 thanks per post
    4. looks_4 SMCJB with 1.3 thanks per post
    1. trending_up 31,198 views
    2. thumb_up 410 thanks given
    3. group 64 followers
    1. forum 137 posts
    2. attach_file 52 attachments




 
Search this Thread

Outside the Box and then some....

  #101 (permalink)
 iantg 
charlotte nc
 
Experience: Advanced
Platform: My Own System
Broker: Optimus
Trading: Emini (ES, YM, NQ, ect.)
Posts: 408 since Jan 2015
Thanks Given: 90
Thanks Received: 1,147

artemiso,

Thank you again for following up with me and providing me with this information.

As you can imagine I am not quite to the point where I have enough capital to bypass broker risk. But I appreciate you providing me with the ballpark figures, so if and when I ever get to that point..... But regarding just developing my own trading platform as an alternative to NT. Let's assume all other variables are constant: (I still go through broker risk, I still have my same proximity hosting) what do you think my speed improvement would be just by dropping NT and going full custom? Is this going from 10 MS down to 2 or 3 MS? And in your opinion would this get me close enough to matter considering:
  • I still have to hit broker risk
  • and considering I won't be plugging directly into the exchange any time soon. (Proximity hosting is all I can likely do for now.)

One final question regarding the chain from Application > Data provider > Broker Risk > Exchange. Is there any scenario where one can bypass broker risk due to the specific type of action they are taking. For example I know that an initial order submitted will have to hit broker risk, but I have seen some posts on this forum that seem to suggest there may be cases of amending actions that may bypass broker risk. For example would any of these actions be able to bypass broker risk?

1. Amending an order by changing quantity
2. Amending an order by changing the price
3. Canceling an order

You may think it's strange that I even asked the question about canceling after a level change, and even though it seems obvious that this is not possible, this is something that I can do with nearly a 100% success rate running NinjaTrader in SIM / Market Replay. I raised this issue with them and even submitted this as a bug, but they kind of dodged my line of questioning around characterizing this as a bug. Here is the thread where I raised my concern and they largely dismissed it. https://forum.ninjatrader.com/showthread.php?p=530462 What this implies is that anyone taking one of those Combine SIMs from TST or any similar company using NT, could completely game the testing as this is a fairly significant exploit.

Regarding the time stamps, I think I will take your advice and just build my own logic to further measure this. I can write some code in my strategy to measure my local clock as it passes from > Cancel Submitted > Canceled.

I think this should be about it as far as any remaining questions I had.
Thanks for taking the time to field my questions.

Ian


artemiso View Post
You do need enough margin capital (YMMV but say 250-500k) and volume for your broker to let you bypass risk, because it takes up some attention span of their trading desk, risk and compliance.




There are 2 separate matters of staleness of your application and quality of your cancellation here.

1. A properly designed application should, by construction, in a pure FIFO market, never allow you to successfully cancel a bid that was resting at 2746 and show you that the best bid has gone below your order. By the time this scenario shows up on the feed, it's already too late.

The only edge case where you can successfully cancel in this scenario is that you placed that bid close enough to the price move (which is quantifiable, but that requires a longer post) that the feed has yet to disseminate that you and/or other parties have improved the best bid, however that doesn't seem like the scenario you're describing to me.

I said a pure FIFO market because there are some markets that allow you to retroactively cancel that bid but that's another issue.

2. The second issue that I'm talking about takes place in a different scenario, which is, your feed tells you that the BB is @ 2746 and your order has been accepted for long enough @ 2746, is there some way to predict that the market will move against you in the next dt time and pull that order in a way that improves your PnL substantially enough to pay off your marginal expenditure on latency improvements? It's possible, but you need to be faster than what's possible for proximity hosting + NT.



I've dealt with external platforms, data and libraries before. One of the less productive, but necessary evils when you use external components is that you need to be able to trust your timestamps.

What's 12:34:56.789 to NT? Exchange timestamp for the event? Vendor timestamp? PC local time? PC local time when it reaches which part of user space? You could, for example, timestamp it yourself in the strategy layer and estimate the duration between that and your own timestamp, which is useful for knowing how fast the application itself is (e.g. in book construction).

For .NET I believe you need to read the literature around the Win32 API (QueryPerformanceCounter) or home brew your own from unmanaged C++ and assembly.


Visit my NexusFi Trade Journal Started this thread Reply With Quote
The following user says Thank You to iantg for this post:

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
58 thanks
Battlestations: Show us your trading desks!
55 thanks
NexusFi site changelog and issues/problem reporting
48 thanks
What percentage per day is possible? [Poll]
31 thanks
GFIs1 1 DAX trade per day journal
29 thanks

  #102 (permalink)
 artemiso 
New York, NY
 
Experience: Beginner
Platform: Vanguard 401k
Broker: Yahoo Finance
Trading: Mutual funds
Posts: 1,152 since Jul 2012
Thanks Given: 784
Thanks Received: 2,685


iantg View Post
As you can imagine I am not quite to the point where I have enough capital to bypass broker risk. But I appreciate you providing me with the ballpark figures, so if and when I ever get to that point..... But regarding just developing my own trading platform as an alternative to NT. Let's assume all other variables are constant: (I still go through broker risk, I still have my same proximity hosting) what do you think my speed improvement would be just by dropping NT and going full custom? Is this going from 10 MS down to 2 or 3 MS? And in your opinion would this get me close enough to matter considering:

Depends on your coding ability. My first dry attempt with other people involved, no optimization (e.g. zero prior benchmarking, no core pinning, some allocations because we had no time to plug our own custom data structure), was <50 mics when we placed our first trade on that system. My second dry attempt with fewer people involved, no optimization was <100 mics when we placed our first trade. My third dry attempt alone, no optimization, was <300 mics on the first trade. The day one latencies actually got slower over time because we became more intelligent about what we actually needed for day one. Our FPGA platform is <1 mic but our slowest setup and venue is about <300 mics.

Main recommendations are to take a minimum viable product (MVP) mindset and plan thoroughly before executing. We spent >90% of the time planning and designing on the white board.


iantg View Post
One final question regarding the chain from Application > Data provider > Broker Risk > Exchange. Is there any scenario where one can bypass broker risk due to the specific type of action they are taking. For example I know that an initial order submitted will have to hit broker risk, but I have seen some posts on this forum that seem to suggest there may be cases of amending actions that may bypass broker risk. For example would any of these actions be able to bypass broker risk?

1. Amending an order by changing quantity
2. Amending an order by changing the price
3. Canceling an order

Your order goes through a different code path depending on the action you're taking. It depends on the exact implementation but it's possible. However this is not a high impact optimization at your stage.

The trickier situation arises when you support different teams, some of which deal with customer flow, who go through the same internalization engine as they might have a lot more heterogenous risk in such a situation.




iantg View Post
You may think it's strange that I even asked the question about canceling after a level change, and even though it seems obvious that this is not possible, this is something that I can do with nearly a 100% success rate running NinjaTrader in SIM / Market Replay. I raised this issue with them and even submitted this as a bug, but they kind of dodged my line of questioning around characterizing this as a bug. Here is the thread where I raised my concern and they largely dismissed it. https://forum.ninjatrader.com/showthread.php?p=530462 What this implies is that anyone taking one of those Combine SIMs from TST or any similar company using NT, could completely game the testing as this is a fairly significant exploit.

You're correct. I'm lazy to trawl through my old posts now but I've pointed out a long time ago that I don't believe in the trading principles behind TST. (For what it's worth I've also successfully forecasted a few things ahead of time: ZenFire shutting down, that a Nanex event study incorrectly attributed a [AUTOLINK]fat finger[/AUTOLINK] error to HFT, FXCM scamming their clients.)

Reply With Quote
The following 3 users say Thank You to artemiso for this post:
  #103 (permalink)
 
SMCJB's Avatar
 SMCJB 
Houston TX
Legendary Market Wizard
 
Experience: Advanced
Platform: TT and Stellar
Broker: Advantage Futures
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
Frequency: Many times daily
Duration: Never
Posts: 5,033 since Dec 2013
Thanks Given: 4,359
Thanks Received: 10,172



iantg View Post
Is there any scenario where one can bypass broker risk due to the specific type of action they are taking. For example I know that an initial order submitted will have to hit broker risk, but I have seen some posts on this forum that seem to suggest there may be cases of amending actions that may bypass broker risk. For example would any of these actions be able to bypass broker risk?

1. Amending an order by changing quantity
2. Amending an order by changing the price
3. Canceling an order

I'd take @artemiso's opinion over mine, but I'm one of those people that was under the impression that modifying the price of an order didnt involve a credit check, but increasing the quantity does.

iantg View Post
You may think it's strange that I even asked the question about canceling after a level change, and even though it seems obvious that this is not possible, this is something that I can do with nearly a 100% success rate running NinjaTrader in SIM / Market Replay. I raised this issue with them and even submitted this as a bug, but they kind of dodged my line of questioning around characterizing this as a bug. Here is the thread where I raised my concern and they largely dismissed it. https://forum.ninjatrader.com/showthread.php?p=530462 What this implies is that anyone taking one of those Combine SIMs from TST or any similar company using NT, could completely game the testing as this is a fairly significant exploit.

I don't think NinjaTrader_RyanS understands what you are talking about, and doesn't understand market dynamics. I thought you outlined the issue quite well, but he just doesn't get it. Position in queue is important if only part of the order book is traded out, but with a 'level change' as you call it, it doesn't matter where in the queue you were, you got filled.

Reply With Quote
  #104 (permalink)
 iantg 
charlotte nc
 
Experience: Advanced
Platform: My Own System
Broker: Optimus
Trading: Emini (ES, YM, NQ, ect.)
Posts: 408 since Jan 2015
Thanks Given: 90
Thanks Received: 1,147


SMCJB View Post
I'd take @artemiso's opinion over mine, but I'm one of those people that was under the impression that modifying the price of an order didnt involve a credit check, but increasing the quantity does.

I don't think NinjaTrader_RyanS understands what you are talking about, and doesn't understand market dynamics. I thought you outlined the issue quite well, but he just doesn't get it. Position in queue is important if only part of the order book is traded out, but with a 'level change' as you call it, it doesn't matter where in the queue you were, you got filled.

SMCJB, Exactly! I don't think they get it either, or see the implications of this. I put it out there mostly as a courtesy to them, and to see if they were aware of it. I honestly don't think they view this as a serious exploit, but it is. It doesn't seem logical at all that this should work in the real market, and I have never got it to work in the real market... I had to ask on here to see if anyone else had got it to work... Long story short, i'ts fiction. That being said, If someone wanted to crush one of those TST combines by cheating they easily could. Here is the code:

if(myEntryOrderS != null && GetCurrentAsk() > fillask && Position.MarketPosition == MarketPosition.Flat )

{
CancelOrder(myEntryOrderS);
}

All you do is just run this on either OnMarketData, or OnMarketDepth. Pass a variable for your original entry price as fillask and every time a price level changes just cancel. (Opposite logic for longs obviously ). It lets you do this around 90% or more of the time. This implies that you will never catch bad entries because you can just cancel right as the market is taking out your level and dropping you down -1 tick.

I took one of my existing strategies that works fairly well, and slapped the above mentioned cancellation logic and it inflates it by around 20% - 30%.

You think I'd pass the combine with this?


Visit my NexusFi Trade Journal Started this thread Reply With Quote
The following 2 users say Thank You to iantg for this post:
  #105 (permalink)
 ocpb 
Hartford CT, USA
 
Experience: Beginner
Platform: None
Trading: ES
Posts: 126 since Jan 2015
Thanks Given: 152
Thanks Received: 125


iantg View Post
That being said, If someone wanted to crush one of those TST combines by cheating they easily could.

This is not something I knew anything about until I read your post above and looked it up. But for TST with NinjaTrader, one connects to Rithmic's "paper trading" servers as a broker service. TST doesn't rely on the NT Sim engine or any desktop platform simulator for fills.

Reply With Quote
The following 2 users say Thank You to ocpb for this post:
  #106 (permalink)
 iantg 
charlotte nc
 
Experience: Advanced
Platform: My Own System
Broker: Optimus
Trading: Emini (ES, YM, NQ, ect.)
Posts: 408 since Jan 2015
Thanks Given: 90
Thanks Received: 1,147


ocpb View Post
This is not something I knew anything about until I read your post above and looked it up. But for TST with NinjaTrader, one connects to Rithmic's "paper trading" servers as a broker service. TST doesn't rely on the NT Sim engine or any desktop platform simulator for fills.


ocpb, Cool, thanks for clarifying this point. I never traded with TST, but I was aware that they used NT to some capacity for their evaluations. I still think you could likely use this hack with just about any SIM though, as most SIM's won't consider an order filled until they have a certain confirmation signal. On price pass-through type of fills such as this scenario, you will typically see a SIM engine confirm that a new price level has been created first, and then react to it. Some will even bake in a latency to simulate pinging the exchange one round trip. If you run your cancel on an event handler like OnMarketData, or OnMarketDepth you can get your cancellation out before they validate the fill.

I would be very curious to see how many SIMs, and which one this hack could beat.

Thanks,

Ian

Visit my NexusFi Trade Journal Started this thread Reply With Quote
The following 2 users say Thank You to iantg for this post:
  #107 (permalink)
 artemiso 
New York, NY
 
Experience: Beginner
Platform: Vanguard 401k
Broker: Yahoo Finance
Trading: Mutual funds
Posts: 1,152 since Jul 2012
Thanks Given: 784
Thanks Received: 2,685


SMCJB View Post
I'd take @artemiso's opinion over mine, but I'm one of those people that was under the impression that modifying the price of an order didnt involve a credit check, but increasing the quantity does.

I hesitate to make a definitive statement here because it's very implementation-specific but I can explain why it's not high impact optimization.

1. Credit checks should be very cheap for you guys, I know because we didn't have to worry about that on the first pass. There's maybe a couple of pointer hops to look up state by asset and account, then a few arithmetic instructions and potential branch misprediction.

2. Some vendors will set up their risk checks in a way you'll have to pass through that code path or at least check that conditional branch even if it's a modify. If your venue has a MIFID II/15c3-5 mandate I've seen sometimes they rather check something redundantly even if it's not necessary from a coding/logic perspective.

3. For CME you don't actually need to do it because it can take place on exchange side so it's 'free' at least because your order gets enqueued by the matching engine before it carries out credit checks. So credit checks only matter if your broker has another layer for stricter risk on top of that.

Reply With Quote
The following user says Thank You to artemiso for this post:
  #108 (permalink)
 soultrader 
Estonia
 
Experience: None
Platform: windows nt
Broker: windows nt
Trading: everything what moves
Posts: 10 since Mar 2014
Thanks Given: 216
Thanks Received: 12


artemiso View Post

I've dealt with external platforms, data and libraries before. One of the less productive, but necessary evils when you use external components is that you need to be able to trust your timestamps.

What's 12:34:56.789 to NT? Exchange timestamp for the event? Vendor timestamp? PC local time? PC local time when it reaches which part of user space? You could, for example, timestamp it yourself in the strategy layer and estimate the duration between that and your own timestamp, which is useful for knowing how fast the application itself is (e.g. in book construction).

It is something I never thought about it. Really good advice @artemiso
 
Code
HOST RECIVED DATA          | NINJA REPORTED TIME
2018.01.25 12:15:55.201575 | Instrument='NQ 03-18 Globex' Type=Ask Price=6959 Volume=4 Time=25.01.2018 12:16:00
2018.01.25 12:15:59.415817 | Instrument='NQ 03-18 Globex' Type=Ask Price=6959 Volume=2 Time=25.01.2018 12:16:04

Reply With Quote
The following 2 users say Thank You to soultrader for this post:
  #109 (permalink)
 Koepisch 
@ Germany
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: FDAX
Posts: 569 since Nov 2011
Thanks Given: 440
Thanks Received: 518

Hi @soultrader,

how did you get the host received time stamps ?

Regards,
Koepisch

Reply With Quote
  #110 (permalink)
 soultrader 
Estonia
 
Experience: None
Platform: windows nt
Broker: windows nt
Trading: everything what moves
Posts: 10 since Mar 2014
Thanks Given: 216
Thanks Received: 12


Not sure is it correct, but: DateTime.Now.ToString("HH:mm:ss.ffffff");

Reply With Quote





Last Updated on June 23, 2018


© 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