Jump to content
Medved Trader Forums

Jason

Members
  • Posts

    208
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Jason

  1. Okay, very interesting, thanks! Will just have to start researching how to do that with the websocket interface.
  2. Thanks for the feedback. Would it be feasible though for each thread managing a trade to establish it's own connection through the websocket? The reason I am attracted to this idea is that I believe doing so would eliminate the need for any parsing to forward responses. As I understand it each response would automatically go right to the thread that issued the request through its own connection eliminating the need for any overhead in keeping track of which responses belong to which trades. But I'm not sure if that's possible.
  3. Checking out other posts here has been very helpful to me so I thought I would ask this here in case the discussion is of value to anyone else developing an application using the API. In my workflow up to this point the software I created has been designed to facilitate the opening/closing of multiple positions with each trade being independently managed by a separate instance of a script which would monitor the price of the symbol and take actions conditionally. None of the code could be multithreaded and the implementation made use of Windows IPC to allow the various scripts running to communicate with each other as needed. This solution is clunky and now, with the new API, avoidable. I have begun developing a replacement for my old workflow by adapting the APITester program you guys provided to mirror the functionality of that workflow. I can send commands, parse the JSON responses, etc. but I'm not sure of the best path to take in duplicating the ability to manage multiple positions. My idea is to create a new thread to take care of managing each trade. As I see it though, the problem becomes making sure that each response received is directed to the thread that generated the corresponding request. I could try matching them by the "reqID" through a complex function that processes all of the responses from the ReceiveBuffer but this feels like a very heavy-handed or brute force way of dealing with it. Is there any way for a request to be sent from a particular thread and have the response automatically directed back to that thread? Would it be possible/better for each thread to open a separate websocket/API connection? Just asking for some advice on how I could proceed as I don't have experience with multithreaded programming or with websockets. Thanks!
  4. Ah, thank you. For some reason was thinking the time was represented according to my system settings.
  5. I am experimenting with the API access and it seems that it's returning the candle data with a time offset and it's not obvious to me why. This is the command I am using through the WSTester: { "cmd": "getCandles", "reqID": "1234", "startDate": "2023-06-23", "candleSize": "2", "regHoursOnly": "true", "sym": "AMD" } The data for the first candle is: { "t": "2023-06-23T13:30:00.000", "o": 109.31, "h": 110.42, "l": 109.13, "c": 110.27, "v": 1436842.0 } This data is correct for the first 2m candle as shown through the MT UI chart but obviously does not correspond to the 2m candle at 1:30pm. I have looked into the ISO date and time format being used without any clarification.
  6. Thanks! Incidentally, I stumbled upon a few things here that renewed my interest in having the ability to do this... https://www.ibkrguides.com/reportingreference/reportguide/trade confirmation configuration.htm Interactive Brokers allows the user to manually specify an "Order Reference" number. I've been able to confirm that this can be done for market orders on the TWS trade ticket and this identifier can be selected for retrieval when running customized reports. If I could specify an identifier and group together multiple transactions as trades then I could do all kinds of in-depth performance analysis. Sites like TradeInsights can assist with some basic performance metrics but methods vary and the cookie-cutter approach they offer isn't sufficient for my purposes. Plus they can choke when attempting to properly match buys and sells from complex positions imported from trade logs.
  7. In my trading setup I use a third party software tool to place and manage my trades in conjunction with MT through IB. It's important that I be able to track performance on a trade level (matching the transactions that liquidate the position to the corresponding transactions that initiated that position). The problem is that when I send an order to exit a position IB has no way of knowing that the order to sell or cover is associated with a particular entry. Simulaneously, while my software is able to perfectly associate every exit with every entry as a complete and separate trade it has no way of matching up the orders transmitted to IB with the Order ID numbers IB assigns to the transactions that fill those orders as you would see on the trade log. So my question is, is there any way through the API or any other way that I can attach a specific order or trade ID to the orders sent to IB? The identification would then allow me to group all associated transactions/fills together as individual trades. I am working exclusively with market orders.
  8. Okay great! The last time I looked into the API it was in dealing with the basic HTTP API with limited options and since then there have been lots of developments I'm behind on. I am already using the HTTP API in my code. Looks like it's time for an upgrade.
  9. In my setup I am using some third party software with automation which needs to occasionally interact with controls/windows in MT. I need to be able to retrieve the final average fill price for orders executed through IB. Now I can see this in some places in MT like, for example, in the Level II window with trading enabled but I am unable to access the information programmatically. The software I use in my work flow is unable to extract information from grid controls, which are prevalent throughout MT. I realize this is not a problem you guys are responsible for solving, but I wanted to ask if there was any way I can get this information exposed through MT or through some API interface that I may not be aware of? Or would I need to create some kind of customized Pthyon/C++/Whatever software interface with IB from scratch? Thought I'd give it a shot and ask.
  10. That's pretty interesting. I also like being able to see clearly current position size highlighted on the Level II window. Thanks
  11. I've noticed something a little odd. Not sure if this began with the new update, which I have installed, or this is from before. Sometimes when entering a symbol into a trade ticket window "SMART" is not the default and is blank instead. Now sometimes SMART is there when loading the symbol even when I do not have it specified as default in application settings for orders. But even when I do have SMART set as default in settings sometimes it still doesn't populate upon symbol load. This behavior is true for both trade ticket and Level II windows with trading enabled. I can't confirm that I've had any issues placing orders due to this. However, I have a system whereby orders are not always submitted through the trade ticket windows by me manually so I am concerned that sometimes when I receive an order rejection from the broker it may be because of this. I am of course using Interactive Brokers. Is anyone else seeing this? Wanted to add that I am seeing this while outside of active trading hours.
  12. Jason

    EMA calculation?

    Awesome Mike, that's what I was wondering about. Have heard of other software using a large fixed value of days back. I'm experimenting with a few things and wanted to be able to replicate the results produced by MT.
  13. Jason

    EMA calculation?

    Have wanted to know, how periods back does MT use when calculating the 20 EMA?
  14. Okay, was able to trigger it again on an older version of my layout which was working fine up to this point. Exact steps were to load the layout, enter settings, change visual style from Black to Blue, click apply. And this pops up. A bit different from my earlier attachment. I have not been able to reproduce corruption of this layout though. What's interesting is that if I click Ignore a few times testing this layout then the program seems to hang and it's as if it's stuck in the middle of loading the layout. After a delay it seems to finish loading. If I then close MT from my task bar and reload it, it seems to load fine with the Blue visual theme. So far I can't seem to recreate the corruption of the layout. It's just going from Black visual theme to Blue or maybe one of the others. This is a weird bug P.S. The other layout that was corrupted, along with its BAK file, is not healed by clicking Ignore on the other Assertion Failed popup.
  15. Should have everything now. Might want to add that my current system is Windows 11 Professional. Also I am seeing this error as well after a fresh system restart without any other software running in the background.
  16. I have posted about this before but I've encountered this again. After changing my style/color of my layout from Black to one of the other options ( I picked Blue then Silver ) I now see the attached window popping up. Once this happens it appears to completely corrupt the layout and the BAK file as I receive the same error after renaming the BAK to .layout. I have seen this failure on two separate computers at this point. Originally I posted about this in August of last year and I am now on a completely new system. This leaves me dead in the water as far trading is concerned and it's extremely frustrating to have to meticulously recreate my entire layout every time this happens. I will send my settings to support after posting this.
  17. That's great! You know I think I saw that while poking around in the menus a while back but wasn't relevant for me at the time and it just didn't stick.
  18. I'm having a problem. I have an account that holds long term positions and I also place intra-day trades out of that account. During the trading session I want to be able to view only open positions for transactions placed during the current day. Of course, the Account tab shows EVERYTHING. Is there any way in MT to filter out all the symbols/positions except those created in the current session? I'm not trading short term any symbols in which I have long term positions and I don't know in advance which symbols I'll be trading throughout the day. I can't think of any way to achieve this but hope I'm missing something.
  19. Yep, it's fixed now, thanks!
  20. Done, I have also done some checking to make sure that I don't have any hotkeys set up anywhere else that could be conflicting with CTRL+=. Incidentally, Donald Q. above posted that CTRL+= on his system is opening the Indicators window for him. Although he may have the hotkey set up on his install to open the indicators menu, from the wording of his post I tend to think that that also is unintended behavior. What's more is that even if I deliberately try to assign CTRL+= to an action in the hotkey configuration window under settings, MT will not allow me to do so. It's as if that key combination is not permitted. That would sort of make sense to me if that key combination were reserved and things worked as they used to where I could simply use CTRL+= to change the period to the custom one I set up manually but like I said, it doesn't work the way it used to.
  21. Yes, I am aware. I can understand not changing the current CTRL hotkeys to remain consistent with how everyone else up to this point has been using them. But my main issue is that CTRL+= currently opens up a new option chain window even though that key combination is not set up as a hotkey in the settings for opening an option chain window. This is new behavior which has been introduced in an update at some point and it breaks the old behavior that I was able to use beforehand. In the past I could set up a custom time period to be anything and then use CTRL+= to switch to that. I should probably post this in the bug reports section as I can't imagine how it could be anything but a bug.
  22. Recently completed a new build and wondered if anyone had experience using MT without a discrete graphics card? I am using MT currently in this new system without a dedicated graphics card. My current CPU is an AMD Ryzen 9 7950X and it performs surprisingly well with quite heavy multitasking. Not sure to what extent this setup may be impacting the performance of the platform. I am utilizing two 3440x1400 monitors. One monitor hosts 21 contiguous 2 minute charts and the other displays a 2m, 5m, 15m, 30m and daily chart of the main symbol I'm viewing along with watchlist, Level II, raw time & sales and account view windows. Along with a simple paintbar almost all chart windows are displaying VWAP with bands and 5 moving averages. Do you think I would see a performance increase after getting a discrete graphics card?
  23. Well, myself I don't see why we can't have CTRL+2 as that's the most intuitive solution but the old functionality was just fine in which we could customize any particular period and assign it to CTRL+=. In fact the way it worked before was more flexible in that you could customize that hotkey to ANY period. As is, the current behavior is significantly more cumbersome for me as now I have a separate dialog to click/Enter through. Which kind of defeats the whole purpose of setting up a hotkey to a function. In resolving this I think some kind of change will be necessary. CTRL+= opening up an option chain window is not expected behavior, and as far as I can tell it's not by design. In my install, the hotkey configuration window under Settings has a line that allows me to assign a hotkey to open an option chain window but it's currently set to *None*. So not only is the current behavior unexpected but it essentially means that two separate hotkeys would be used up to achieve the same result should the user prefer to open an option chain window via a different hotkey. In my case, the difficulty is exacerbated by the fact that I am using third party software to interact with MT by sending hotkeys to the platform when certain conditions are met. The current functionality breaks this and while I can code a solution and test it doing so is a PITA.
  24. Having kind of a strange problem. I like to be able to quickly switch between chart periods and need to be able to do so for the 2min period. In the past I could set up the 2min period as a custom period activated by CTRL+= however it seems that that no longer works. Incidentally, is there a special reason why CTRL+2 doesn't set the period the way the other numbers would? Always wondered about that. As is, CTRL+= always opens an option chain window even though that can be separately configured with a different hotkey combo in the settings. Thanks
  25. But I still have a small target to move to hit with the mouse. Instead, I could just use a keyboard shortcut. In my setup I have a lot of charts and it's very common that I need to minimize and then restore everything. In fact, I'm very surprised that this hasn't been previously addressed. Especially considering how simple a function it is and how many configurable shortcuts there are for just about everything else. It is possible for me to put together a solution in my code using scripts but that's a kludgy fix that imposes a significant performance penalty. Natively, the minimizing functionality of MT is vastly superior.
×
×
  • Create New...