Hi there,
How exactly is getvalue() calculated? I understand it is the sum of everything you have invested in market + cash?
This should then mean that getvalue() -getcash() = sum of current value of everything invested in market (stocks).
However, when I add up the value of my stocks held, it does not equal this.
See my example print out below (totalwealth = getvalue(), invested = getvalue() - cash()), my invested value says only $27,000. But when you add up my stocks held, its more like $66,000...
2012-12-28, ORDER CANCELLED - TP: ABC, Trade Ref: 1037
2012-12-28, SELL EXECUTED - Closed Long Pos: SUN, Ref: 1039, Price: 9.97, PNL: 123.47, Purchase Cost: 8379.68, Comm 10.24
2012-12-28, SELL EXECUTED - Closed Long Pos: CTX, Ref: 1040, Price: 19.10, PNL: 520.93, Purchase Cost: 8284.17, Comm 10.61
2012-12-28, BUY EXECUTED - Entered Long Pos: TTS, Ref: 1041, Price: 3.01, Cost: 8298.57, Size: 2757.00, Comm 10.00
2012-12-28, BUY EXECUTED - Entered Long Pos: CHC, Ref: 1042, Price: 3.32, Cost: 8373.04, Size: 2522.00, Comm 10.09
2012-12-28, OPERATION PROFIT: SUN, GROSS 123.47, NET 103.13
2012-12-28, CANCELLING STOP-LOSS: SUN, Ref: 216
2012-12-28, CANCELLING TAKE-PROFIT: SUN, Ref: 216
2012-12-28, OPERATION PROFIT: CTX, GROSS 520.93, NET 500.34
2012-12-28, CANCELLING STOP-LOSS: CTX, Ref: 211
2012-12-28, CANCELLING TAKE-PROFIT: CTX, Ref: 211
2012-12-28, Stock held: TTS, Close: 3.01, score: 0.93, Score Yest: 0.92, Posn: 2757.00, hold days 1
2012-12-28, CREATE SL: TTS, Trigger Price: 2.71
2012-12-28, CREATE TP: TTS, Trigger Price: 9.03
2012-12-28, Stock held: MTS, Close: 3.38, score: 1.00, Score Yest: 0.99, Posn: 2569.00, hold days 6
2012-12-28, Stock held: FLT, Close: 27.03, score: 0.99, Score Yest: 1.00, Posn: 302.00, hold days 27
2012-12-28, CREATE BUY: ABC, Close: 3.11, score: 0.94
2012-12-28, Stock held: MYR, Close: 2.01, score: 1.00, Score Yest: 1.00, Posn: 4221.00, hold days 25
2012-12-28, Stock held: CHC, Close: 3.31, score: 0.95, Score Yest: 0.92, Posn: 2522.00, hold days 1
2012-12-28, CREATE SL: CHC, Trigger Price: 2.98
2012-12-28, CREATE TP: CHC, Trigger Price: 9.93
2012-12-28, Stock held: MQA, Close: 1.68, score: 0.97, Score Yest: 0.97, Posn: 5076.00, hold days 7
2012-12-28, CREATE BUY: SMX, Close: 4.64, score: 0.91
2012-12-28, Stocks Held: 6, Total Wealth: 104603, Invested: 27280, Cash-On-Hand (pre-today's buys): 77323
2012-12-28, Ending Wealth: 104603, Invested: 27280, Cash-On-Hand: 77323,
Perhaps I am interpreting the getvalue()
definition wrong? Otherwise, any ideas why these numbers dont equate?
Thank you