PureBytes Links
Trading Reference Links
|
Bernard -
Check the restating of the cum formula just under your note
Frank
At 09:18 AM 8/12/01 +0200, you wrote:
Hello
I have the following exploration
:
buy = cross (macd(), 0);
sell = cross ( 0, macd());
buy = exrem( buy, sell);
sell = exrem (sell, buy);
position = iif(buy, 1, iif( sell, -1,
0));
buyprice = valuewhen( buy, C, 1);
sellprice = ValueWhen( sell, C, 1);
profit = buyprice - sellprice;
PProfit = 100 * Profit / BuyPrice;
CumProfit = Sum( Profit, BarsSince(Profit));
CumProfit = Sum(PProfit,BarsSince(Profit));
cumprofit should probably be sum of PProfit, not Profit
filter =buy
or sell;
numcolumns = 6;
column0 = position;
column0Name ="Pos.";
column1= buyprice;
column1Name = "Buy p.";
column2 = sellprice;
column2Name = "Sell P.";
column3 = profit;
column3Name = "Profit";
column4 = PProfit;
column4Name = "Profit%";
column5 = CumProfit;
column5Name = "CumProf.";
Everything is OK except for the CumProfit which give 0.
The idea is to obtain in this column the cumulative profit trade by
trade.
Any idea ?
Bernard Bourée
bernard@xxxx
Your use of Yahoo! Groups is subject to the
Yahoo! Terms of
Service.
|