Pagina 1 van 1

Excel en Vestics - Bouwen van een Rapport in Excel

BerichtGeplaatst: di 09 dec 2003, 20:25
door douwe
Aloha,

Wie heeft er ervaring met het bouwen van een rapportage/evaluatie in Excel??

Ik probeer met onderstaande Easylanguage code gegevens te exporteren naar Excel, maar ik krijg dan de melding dat "file" niet gevonden kan worden of niet toegankelijk is. kan iemand me helpen

mvg,
douwe

Vars: FileName(""),TotTr(0),Prof(0),CumProf(1),ETop(1),TopBar(0),TopInt(0),
BotBar(0),BotInt(0),EBot(1),EDraw(1),TradeStr2("");

If CurrentBar=1 Then Begin
FileName = "C:\exportvestics\"+LeftStr(GetSymbolName,2)+".csv";
FileDelete(FileName);
TradeStr2="E Date" + "," + "Position" + "," + "E Price" + "," + "X Date" +
"," + "X Price" + "," + "Profit" + "," + "Cum.prof." + "," + "E-Top" + "," +
"E-Bottom" + "," + "Flat time" + "," + "Run up" + "," + "Drawdown" + Newline;
FileAppend(FileName,TradeStr2);
end;

TotTr=TotalTrades;
If TotTr [1] Then Begin
Prof=1 + PositionProfit(1)/(EntryPrice(1)*BigPointValue);
CumProf=CumProf*Prof;
ETop=MaxList(ETop,CumProf);
If ETop>ETop[1] Then Begin
TopBar=CurrentBar;
EBot=ETop;
end;

EBot=MinList(EBot,CumProf);
If EBot<EBot[1] Then
BotBar=CurrentBar;
TopInt=CurrentBar-TopBar;
BotInt=CurrentBar-BotBar;
EDraw=CumProf/ETop;
TradeStr2=NumToStr(EntryDate(1),0) + "," +
NumToStr(MarketPosition(1),0) + "," + NumToStr(EntryPrice(1),2) +
"," + NumToStr(ExitDate(1),0) + "," + NumtoStr(ExitPrice(1),2) + ","
+ NumToStr((Prof-1)*100,2) + "," + NumToStr((CumProf-1)*
100,2) + "," + NumToStr((ETop-1)*100,2) + "," +
NumToStr ((EBot-1)*100,2) + "," + NumToStr(TopInt,0) +
"," + NumToStr(BotInt,0) + "," + NumToStr((EDraw-1)*100,2) +
NewLine;
FileAppend(FileName,TradeStr2);
end;

Excel en Vestics

BerichtGeplaatst: wo 10 dec 2003, 9:14
door Paul M
Hoi Douwe,

Ik heb hem iets omgebouwd, dit is zo'n voorbeeld dat niet in Vestics werkt. Als je het verhaal aanpast, filedelete-file append, zoals ik gedaan heb dan geeft hij een error in de functie maxlist.
Ik heb geen tijd gehad de waarden te controleren, omdat ik veel van deze waarden door excel laat uitrekenen. Maar ik hoor het wel.

TStridsmanreport:

Vars: FName(""), TotTr(0), Prof(0), CumProf(1), ETop(0), xTopBar(0), TopInt(0), BotBar(0),
BotInt(0), EBot(0), EDraw(1), TradeStr2(""),xdate(0),xExitdate(0),xExit(0),
xCurrentBar(0),xMP1(0),xMP(0),xPercProf(0),xCumPercProf(0),xTotaltrades(0),xProf(0);

xExitdate:=ExitDate(1) ;
xCurrentBar=currentbar;
xMP=Marketposition(1);
xMP1=Marketposition(2);
xExit=exitprice(1);

If CurrentBar = l Then Begin
FileDelete("C:\Stridsman\Chap1-2.xls");
End;

TotTr = TotalTrades;
If TotTr > TotTr[1 ] Then Begin
Prof = 1 + PositionProfit(1)/(EntryPrice(1);
CumProf = CumProf * Prof;
value1=CumProf;

ETop = MaxList(Value2,value1 );
if xMP then Value5=Value2;
If ETop>Value5{ETop > ETop[1]} ?Then Begin
xTopBar=xcurrentbar;
EBot = ETop;
End;
EBot = MinList(Value3,Value1 );
if xMP then Value6=Value3;
If EBot<Value6{EBot[1]} Then BotBar = xCurrentBar;
TopInt = CurrentBar - xTopBar;
BotInt = CurrentBar - BotBar;
EDraw = CumProf / ETop;
Value3=Value2;
xProf=PositionProfit(1);

if xExitdate<>xExitdate[1] then begin
Value2=Etop;
Value3=EBot;
end;

TradeStr2 = ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {Excel Kolommen}
LeftStr(GetSymbolName, 10)+ "," + ? ? ? ? ? ? ? {A}
NumToStr(MarketPosition(1), 0) + "," + ? ? ? ? ?{B}
NumToStr(EntryDate(1), 0) + "," + ? ? ? ? ? ? ? {C}
NumToStr(EntryPrice(1), 2) +"," + ? ? ? ? ? ? ? {D}
NumToStr(ExitDate(1), 0) + "," + ? ? ? ? ? ? ? ?{E}
NumToStr(exitprice(1), 2) + ?"," + ? ? ? ? ? ? ?{F}
NumToStr((Prof-1)*100, 2) + "," + ? ? ? ? ? ? ? {G}
NumToStr((CumProf-1)*100, 2) + "," + ? ? ? ? ? ?{H}
NumToStr((EDraw-1)*100, 2) + "," + ? ? ? ? ? ? ?{I}
NumToStr((ETop-1)*100, 2) + "," + ? ? ? ? ? ? ? {J}
NumToStr((EBot-1)*100, 2) + "," + ? ? ? ? ? ? ? {K}
NumToStr(TopInt, 0) + "," + ? ? ? ? ? ? ? ? ? ? {L}
NumToStr(BotInt, 0)+ "," + ? ? ? ? ? ? ? ? ? ? ?{M}
NumToStr(Tottr, 0); ? ? ? ? ? ? ? ? ? ? ? ? ? ? {N}
FileAppend("C:\Stridsman\Chap1-2.xls",TradeStr2);

End;


Paul

via edit kopieeren.

(Edited by Paul M at 9:17 am op 10,dec. 2003)

Excel en Vestics

BerichtGeplaatst: wo 10 dec 2003, 22:08
door douwe
beste Paul,

de EntryPrice en ExitPrice zijn hetzelfde in het excelblad en ik kan niet vinden waar het aan ligt. Ook heb ik de .xls in .csv veranderd, ik kon het anders niet importeren in excel.

Heb je een oplossing voor het probleem dat EntryPrice en ExitPrice het zelfde zijn???

mvg,
douwe

Excel en Vestics

BerichtGeplaatst: wo 10 dec 2003, 22:59
door Paul M
Douwe,

Met welke versie van Vestics werk je, dit werkt in de nieuwe versie.
Er zijn nl. een aantal dingen verandert, de exitprice(1) werkt in de oude versie niet.
Wil je dit in de oude versie dan moet je een aantal dingen veranderen.
xExitdate:=ExitDate(1) veranderen in xExitdate:=ExitDate(1) -19000000;

Toevoegen onder vars: xDate(0); dan xdate definieren
Xdate=date;

xExit=exitprice(1); ?verwijderen.

if xExitdate<>xExitdate[1] then begin
Value2=Etop;
Value3=EBot;
end; ?veranderen in:
if Xdate=xExitdate then begin
xExit=close;
Value2=Etop;
Value3=EBot;
end;


NumToStr(exitprice(1), 2) + ?"," + ? ? ? ? ? ? ?{F} ?veranderen in
NumToStr(xexit, 2) + ?"," + ? ? ? ? ? ? ?{F}

Dan moet hij het volgens mij doen zo niet hoor ik het wel.

Paul.

Excel en Vestics

BerichtGeplaatst: zo 14 dec 2003, 18:36
door douwe
Beste Paul,

Ik heb de beta versie even gedownload en op mijn laptop gezet en het werkt perfect. heb alleen .xls veranderd in .csv. Als ik .xls gebruik ziet Excel het als een soort koppeling met een datafeed, tenminste mijn versie.

Heb je nog tips en/of trucs om een rapportage te maken in Excel, ik wil zelf het boek van Thomas Stridsman als basis gebruiken.

In iedergeval bedankt voor je reactie.

mvg,
douwe

Excel en Vestics

BerichtGeplaatst: zo 14 dec 2003, 21:34
door Paul M
Hallo Douwe,

Check e-mail.

Paul

Excel en Vestics

BerichtGeplaatst: zo 14 dec 2003, 22:08
door douwe
beste Paul,

Welke? Bedoel je van het forum? want die is leeg!

mvg,
douwe

(Edited by douwe at 2:26 pm op 15,dec. 2003)