[amibroker] PnL of one day

 

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)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

**** IMPORTANT PLEASE READ ****
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