PureBytes Links
Trading Reference Links
|
Dear Netters,
I need to compute the amount I paid for a stock at market.
So, when I get an entry signal I write:
Value1 = DollarstoShares(Cash);
Buy Value1 Contracts at market;
Cash = Cash - (Value1*@EntryPrice(1));
and when I get an exit signal I write:
exitlong at market;
Cash = Cash +(CurrentContracts*@ExitPrice(1));
The trouble is that these are market orders that are executed at
tomorrow's opening price.
And neither @EntryPrice(1) nor @ExitPrice(1) are the open of
tomorrow and I cannot figure out how to code them to use in order
to update my cash position.
Do any of you know how to solve this? Maybe GOD (Good Old
Dennis) or any of you can help me.
Thank you all in advance,
Sincerely,
Alfredo
|