ahujat Posted January 12, 2023 Report Share Posted January 12, 2023 1. Can support for 'Mid Price' be added to the 'Horizontal Line' indicator. It has support for bid/offer/last but not for Mid-Price. 2. Right now, the calculation of Mid-Price is nearer to 'Offer', in the case offer- bid is an odd value. Can that be made configurable to be nearer to bid? e.g., if offer is at 2.53 and the bid is at 2.5, the Mid-Price is calculated as 2.52. Can that be made configurable to be like 2.51 instead? It's especially useful when closing out the options, nearest to the bid. Quote Link to comment Share on other sites More sharing options...
ahujat Posted February 16, 2023 Author Report Share Posted February 16, 2023 I was able to do most of this functionality via hotkeys and Paintbar. I need to do a custom P&L calculation logic in Paintbar but can't seem to find a way to access the 'system variables' in t Paintbars. System variables that accessible in Hotkeys, that is. Like PosPaid, LastFillPrice, etc Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted February 17, 2023 Report Share Posted February 17, 2023 Paintbars/scans are not tied to any particular account... It's true you could specify the account right in the function call. Would have to think on it. Quote Link to comment Share on other sites More sharing options...
ahujat Posted February 17, 2023 Author Report Share Posted February 17, 2023 Even Hotkeys default to the Account selected in that window and if you need to change the account, you can specify it explicitly. Same Hotkey can exist in multiple types of windows (Level II, Trade Ticket, etc.) while the Paintbar is tied to a specific chart window, where it's enabled. I guess it can default to the account selected in the that window. No? Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted February 17, 2023 Report Share Posted February 17, 2023 Yes. The problem (a bit) is that hotkey is executed once while paintbar is executed potentially 100,000 times within a fraction of a second. Accessing the account data is not fast... Will check on it. Quote Link to comment Share on other sites More sharing options...
ahujat Posted February 24, 2023 Author Report Share Posted February 24, 2023 On 2/17/2023 at 12:00 PM, Mike Medved said: Yes. The problem (a bit) is that hotkey is executed once while paintbar is executed potentially 100,000 times within a fraction of a second. Accessing the account data is not fast... Will check on it. Any Update on this. Meanwhile, can the P&L calculation be based on Midpoint of Bid/Ask rather than Last? In Options, in some cases, the difference between last and Midpoint can be quite a bit. Also, I believe IB does the calculations based on Midpoint of Bid/Ask rather than last. Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted February 27, 2023 Report Share Posted February 27, 2023 I have a full plate in front of me right now. Please drop me an email in a week or so pointing to this thread to remind me of it. Quote Link to comment Share on other sites More sharing options...
ahujat Posted March 15, 2023 Author Report Share Posted March 15, 2023 Mike, I sent you the reminder email last week. Any plans to support this? Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted March 16, 2023 Report Share Posted March 16, 2023 Ok. Can you give me a list of variables that you need accessible. And it would be per account per symbol, right? Quote Link to comment Share on other sites More sharing options...
ahujat Posted March 16, 2023 Author Report Share Posted March 16, 2023 Hmm, will make a list of the variables needed but just wondering if each variable requires a special handling for it be supported (in the paintbar)? Yes, per account per symbol. Quote Link to comment Share on other sites More sharing options...
ahujat Posted March 16, 2023 Author Report Share Posted March 16, 2023 Mailed you the list. Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted March 20, 2023 Report Share Posted March 20, 2023 Working on that. Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted March 31, 2023 Report Share Posted March 31, 2023 this beta has account specific stuff Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted April 1, 2023 Report Share Posted April 1, 2023 You set Trading_AccountNumber to the account ID of the trading account defined in MT. Then all the Trading_* variables populate. Quote Link to comment Share on other sites More sharing options...
ahujat Posted April 2, 2023 Author Report Share Posted April 2, 2023 Cool. Thank you. How does the Trading_LastFillPrice and Trading_LastFillQty work? I am not sure if they are auto updated whenever a trade happens. I had to Hide the Paintbar indicator and then show the indicator for it to update. Quote Link to comment Share on other sites More sharing options...
ahujat Posted April 2, 2023 Author Report Share Posted April 2, 2023 Ok. Found the issue. I was using the last trade (Horizontal Line 'Last') in the paintbar. Paintbar gets updated when the next trade happens, which causes a lag depending on when the next trade happens. Changed it to Bid/Ask and it gets updated immediately. Quote Link to comment Share on other sites More sharing options...
ahujat Posted April 10, 2023 Author Report Share Posted April 10, 2023 There seems to be some issue with Coinbase. Paintbar gets the correct values for Trading_Pos and Trading_PosPaid but Trading_LastFillQty and Trading_lastFillPrice are always 0. Works totally fine with Tradier. Quote Link to comment Share on other sites More sharing options...
ahujat Posted June 30, 2023 Author Report Share Posted June 30, 2023 I am seeing an issue with Partial fills. I believe when a partial fill happens, The Trade_LastFillQty returns the number of shares in that particular order and not the partial fill. This happens rarely, so difficult issue to debug. Can you please check if that's the case? Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted July 6, 2023 Report Share Posted July 6, 2023 that is correct. Trading_LastFillQty is the FillQTY on the last order executed Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.