Author |
Topic: Net Liq in AccountSummary (20 messages, Page 1 of 1) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
THarnett81 Posts: 78 Joined: Jan 13, 2011 |
We've made an Account Summary window similar to the Account Summary window in OEC Trader, but when we run them side-by-side we see that our "Net Liq" value becomes different than OEC Trader's.
We're not doing any complex math here. When we receive an Account update, we set the displayed value to Account.TotalBalance.NetLiquidatingValue. You can see the divergence in this video: http://www.screencast.com/t/VVYkLriPBXUv (password is deltamd) So I can only guess that we're using the wrong variable. What variable should we use to get the value that OEC Trader displays as in the graphic below? ![]() Edited by THarnett81 on May 10, 2012 at 16:24:40 |
||||
VictorV Posts: 746 Joined: May 08, 2007 ![]() |
Trader shows the next value:
NetLiquidatingValue - SettlePnL + OpenPnL Victor Vins Lead Software Developer |
||||
THarnett81 Posts: 78 Joined: Jan 13, 2011 |
So the "Net Liq" displayed value is not actually Account.TotalBalance.NetLiquidatingValue? That is unexpected. So I should set my displayed value to be equal to your formula? (where all 3 operands are members of Account.TotalBalance) Edited by THarnett81 on May 11, 2012 at 16:41:35 |
||||
THarnett81 Posts: 78 Joined: Jan 13, 2011 |
Victor,
There is still a problem. When the trader's position is not flat, it seems to work and the values in my app and OEC Trader seem to stay in sync. But when the trader flattens his position, the numbers become different. See this video: http://www.screencast.com/t/qzuW4Jjhd0YJ Please advise. |
||||
VictorV Posts: 746 Joined: May 08, 2007 ![]() |
Hello. Does it sync after logon with flatten position?
Victor Vins Lead Software Developer |
||||
VictorV Posts: 746 Joined: May 08, 2007 ![]() |
Moreover, I see you had balances for two currencies. Could you please check that your window is updating with "total" balance all the time?
Victor Vins Lead Software Developer |
||||
THarnett81 Posts: 78 Joined: Jan 13, 2011 |
"Does it sync after logon with flatten position?" - I think you're asking if the value is correct after login but before any orders are placed... is that right?
The market is closed right now, but we can get back to you on this. |
||||
THarnett81 Posts: 78 Joined: Jan 13, 2011 |
"Could you please check that your window is updating with "total" balance all the time?"
Here is the exact code line that pulls the value: d.NetLiquidity = System.Convert.ToDecimal( Can you confirm this is correct? Edited by THarnett81 on May 18, 2012 at 16:41:52 |
||||
VictorV Posts: 746 Joined: May 08, 2007 ![]() |
Yes, this is correct.
Victor Vins Lead Software Developer |
||||
THarnett81 Posts: 78 Joined: Jan 13, 2011 |
(deleted)
Edited by THarnett81 on May 18, 2012 at 16:43:34 |
||||
THarnett81 Posts: 78 Joined: Jan 13, 2011 |
I'm sorry, which post is correct?
|
||||
VictorV Posts: 746 Joined: May 08, 2007 ![]() |
Both. It would be nice to compare values before any orders placed and positions opened; formula is correct.
The difference on your video was pretty close to value of non-USD balance in your account. It looked like your software updated the screen with total balance during active phase and just with USD balance when positions were closed. Victor Vins Lead Software Developer |
||||
THarnett81 Posts: 78 Joined: Jan 13, 2011 |
Interesting.
I don't think we're doing that though. There is a single function that copies over the AccountSummary data. Any update uses that same block of assignments, which includes the line I had pasted. Aside from checking the Net Liq after login (before any trading), what else can we look at? |
||||
VictorV Posts: 746 Joined: May 08, 2007 ![]() |
Could you turn on logging in OECAPI via http://www.openecry.com/api/api/OEC.Log.html class?
Victor Vins Lead Software Developer |
||||
THarnett81 Posts: 78 Joined: Jan 13, 2011 |
I turned on logging. Market's closed, so not much to see. Guess I'll have to get back to you later.
|
||||
THarnett81 Posts: 78 Joined: Jan 13, 2011 |
What should I be looking for in this log, Victor?
Just a minute ago, I ran it, placed a few market orders followed by a flatten order, and there really isn't much to see in the log. 12:32:09.951 Dbg Reader Order Login to OEC Server 4.1.0.0
|
||||
VictorV Posts: 746 Joined: May 08, 2007 ![]() |
I just figured out that our Advanced Example uses the same formula above as Trader and describes how to turn on detailed logs. Could you try to run side-by-side all three applications? Advanced Example will need a minor changes in code to update Net Liq by price changes. I don't see any de-synchronizations when I ran the example and Trader.
Victor Vins Lead Software Developer |
||||
THarnett81 Posts: 78 Joined: Jan 13, 2011 |
Can you elaborate on this:
"Advanced Example will need a minor changes in code to update Net Liq by price changes" Are you talking about the OnPriceChanged callback? (If yes, then I think I'll need to add code to track the Account and Currency myself since this event type does not give me that.) Also, our app is not listening to OnBalancedChanged. Is it advised that we should be using this one (in addition to OnAccountSummaryChanged)? Edited by THarnett81 on May 23, 2012 at 18:55:05 Edited by THarnett81 on May 23, 2012 at 18:55:37 Edited by THarnett81 on May 23, 2012 at 18:56:05 |
||||
VictorV Posts: 746 Joined: May 08, 2007 ![]() |
Sorry, I was wrong with "Advanced Example will need a minor changes in code to update Net Liq by price changes" (looked to another branch of this sample): you don't need any changes there. All what you need is to listen OnBalanceChanged and OnAccountSummaryChanged events.
Victor Vins Lead Software Developer |
||||
THarnett81 Posts: 78 Joined: Jan 13, 2011 |
In my app, we're not listening to OnBalanceChanged. Do you think this might explain our unsynch'd values?
|
||||