PureBytes Links
Trading Reference Links
|
On Mon, 29 Jul 2002, Ian MacAuslan wrote:
> I've written a simple piece of code to just copy out to a disk file the
> P&L of a trade whenever a trade is closed out. It appears there is a
> bug somewhere--or perhaps I'm not doing something quite right. Executed
> on the bar immediately following a position being closed out, It should
> write out simply the symbolname and the P&L of that last
> trade...Instead, I get many duplicate lines, though not apparently any
> particular number of duplicates.
>
> Here is the code, which I paste into the bottom my strategy--any
> strategy, take one of the canned ones from TradeStation:
> =====
> vars: MP(0), plstring("");
>
> MP = MarketPosition;
>
> if MP = 0 and MP[1] <> 0 then begin
> plstring = GetSymbolName + ", " + PositonProfit(1) + NewLine;
> FileAppend("c:\mytrades.txt", plstring);
> end;
> =====
take off the 'update on every tick' property
|