door Paul M » ma 28 apr 2003, 11:03
Hoi Geert,
Ik heb het volgende gevonden, maar dit werkt volgens mij niet binnen Vestics.
{***************************************
Written by: Konstantin Kopyrkin (aka konkop) 29.08.2001
Description: This function calculate and output strategy
percentage Profits and MFE trade by trade.
Copyright (c) konkop, 2001
*************************************** *}
Vars: Trades (0), Pprofit (0), HHigh (H), LLow (L), MFE (0);
?
Trades = TotalTrades;
?
If Trades < > Trades [1] Then begin
If MarketPosition (1) = 1 Then begin
Pprofit = (ExitPrice (1) - EntryPrice (1))/EntryPrice (1)* 100;
HHigh = Highest (High, BarssinceEntry (1));
If HHigh > = EntryPrice (1) Then MFE = (HHigh-EntryPrice (1))/EntryPrice (1)* 100 else MFE = 0;
End;
If MarketPosition (1) =-1 Then Begin
Pprofit = (EntryPrice (1) - ExitPrice (1))/EntryPrice (1)* 100;
LLow = Lowest (Low, BarssinceEntry (1));
If LLow < = EntryPrice (1) Then MFE = (EntryPrice (1)-LLow)/EntryPrice (1)* 100 else MFE = 0;
End;
End;
$MFE_report = 1;
?
If BarNumber=1 Then Print (File ("C:\MFE_report.csv" ", Symbol " ",", "Strategy" ",", "Date" ",", "Time" ",",
"Trades" ",", "MP" ",", " Profit () " ",", " MFE () ");
If Trades < > Trades [1] then
Print (File ("C:\MFE_report.csv", GetSymbolName + "," + GetStrategyName + "," + ELDateToString (Date) + "," +
NumToStr (ExitTime (1), 0) + "," +NumToStr (Trades, 0) + "," +NumToStr (MarketPosition (1), 0) + "," +NumToStr (Pprofit, 2) + "," +NumToStr (MFE, 2));
{***************************************}
Groetjes Paul
(Edited by Paul M at 3:11 pm op 29,april 2003)