How to call and get the "Net Liquidation Value" or "Cash Value" or "Available Funds" of an account??
Posted: Wed Mar 14, 2018 4:50 am
Hello,
I'm trying to call and get the "Net Liquidation Value" of our 5 sub-accounts combined, how do I do this? This is is code I'm using in our TradeStation EasyLanguage Script but it only returns the "Buying Power" of all accounts combined, instead, I need to get the "Net Liquidation Value" of all accounts combined:
NetLiq = GET_ACC_VAL(12,"","",0);
Is the above line of code correct? If I can't get the "Net Liquidation Value" of all 5 sub-accounts combined, I would like to get the "Cash Value" or "Current Available funds" of all 5 sub-accounts combined instead? Is this possible to do via TWS-Link? What am I doing wrong?
For example, assume I have 5 sub-accounts with $1,000 USD in each sub-account (where all 5 sub-accounts are put into a TWS "Account Group" called "Group1"), I then want to call and get the "Net Liquidation Value" of all 5 accounts "combined" which should return a value of $5,000 USD, to do this I tried using this line of code (but it did not work): NetLiq = GET_ACC_VAL(12,"USD","Group1",0);
The above GET_ACC_VAL code did not work for me, it looks like I'm coding it wrong? Could you please let me know the correct way to code this?
Reason I ask this question is that getting the combined Buying Power of all 5 sub-accounts is not "reliable" as it changes by a large amount at night. For example, during the day buying power is 4 times the account cash value but at night it is only 2 times the account cash value (which is a big difference), so buying power can't be used to set position size (as it changes during the day/night by a very large amount), instead we need to use total combined "Net Liquidation Value" or "Cash Value" or "Current Available funds" of the 5 sub-accounts to set the correct position size i.e. our trading strategy sets position size equal to 1% of account "Net Liquidation Value".
Many thanks in advance.
Regards,
Rod
I'm trying to call and get the "Net Liquidation Value" of our 5 sub-accounts combined, how do I do this? This is is code I'm using in our TradeStation EasyLanguage Script but it only returns the "Buying Power" of all accounts combined, instead, I need to get the "Net Liquidation Value" of all accounts combined:
NetLiq = GET_ACC_VAL(12,"","",0);
Is the above line of code correct? If I can't get the "Net Liquidation Value" of all 5 sub-accounts combined, I would like to get the "Cash Value" or "Current Available funds" of all 5 sub-accounts combined instead? Is this possible to do via TWS-Link? What am I doing wrong?
For example, assume I have 5 sub-accounts with $1,000 USD in each sub-account (where all 5 sub-accounts are put into a TWS "Account Group" called "Group1"), I then want to call and get the "Net Liquidation Value" of all 5 accounts "combined" which should return a value of $5,000 USD, to do this I tried using this line of code (but it did not work): NetLiq = GET_ACC_VAL(12,"USD","Group1",0);
The above GET_ACC_VAL code did not work for me, it looks like I'm coding it wrong? Could you please let me know the correct way to code this?
Reason I ask this question is that getting the combined Buying Power of all 5 sub-accounts is not "reliable" as it changes by a large amount at night. For example, during the day buying power is 4 times the account cash value but at night it is only 2 times the account cash value (which is a big difference), so buying power can't be used to set position size (as it changes during the day/night by a very large amount), instead we need to use total combined "Net Liquidation Value" or "Cash Value" or "Current Available funds" of the 5 sub-accounts to set the correct position size i.e. our trading strategy sets position size equal to 1% of account "Net Liquidation Value".
Many thanks in advance.
Regards,
Rod