I use a formula to write the PnL of my intraday-trades in the Interpretation window.
How can I calculate the Sum of PnL of the actual day and write it also in this window?
Thanks
_SECTION_BEGIN("Trades");
BuyExRem=ExRem(Buy,Sell);
SellExrem=ExRem(Sell,Buy);
printf("\n Symbol = " + Name()+"\n ");
myDate=day();
myMonth=Month();
myYear=Year();
myTime=Hour()*100+Minute()*1;
for( i = 0; i < Barcount; i++ )
{
if( BuyExrem[i] )
{
BuyPrice=C[i];
printf( "\n Date = " + myDate[i] + " . " +myMonth[i] + " . " +myYear);
printf( "\n Time = " + myTime[i]);
printf( "\n Buyprice = " + Buyprice[i]);
}
if( SellExrem[i] )
{
SellPrice=C[i];
Zeit=TimeNum();
Points=SellPrice-LastValue(BuyPrice);
PNL=Points*25;
printf( "\n Sellprice = " + Sellprice[i]);
printf( "\n Time = " + myTime[i]);
printf( "\n Date = " + myDate[i] + " . " +myMonth[i] + " . " +myYear);
printf( "\n Points = " + Points[i] );
color=IIf(PNL>0,colorGreen,colorRed);
printf(EncodeColor(color)+ "\n PNL = " + PNL[i]+ " EUR"+EncodeColor(colorBlack));
printf( "\n " );
}
}
_SECTION_END();
Posted by: Michael.G.Heiss@t-online.de
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (1) |
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
EmoticonEmoticon