Jump to content
Medved Trader Forums

Couple more requests for 'Mid Price'


ahujat

Recommended Posts

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. 

 

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

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. 

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

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? 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...