Code: Select all
vars: lastTradingDay(false);
lastTradingDay = false;
If month(date of next bar) <> month(date) then begin
lastTradingDay = true;
end;
Code: Select all
vars: lastTradingDay(false);
lastTradingDay = false;
If month(date of next bar) <> month(date) then begin
lastTradingDay = true;
end;
Code: Select all
///////////////////////MONTHLY OUTPUT
vars: lastTradingDay(false),MontlyProfit(0);
lastTradingDay = false;
If month(date of next bar) > month(date) then begin
lastTradingDay = true;
end;
If lastTradingDay then begin
MontlyProfit= Netprofit;
end;
If lastTradingDay then FileAppend("C:\Users\utente\Desktop\outputMulticharts\ReportMensilePortafoglio.txt",
symbol +" "+getstrategyname +" " +FormatDate("dd-MM-yyyy", DateToJulian(Date) )+" " + NumToStr(MontlyProfit,2)+ " " +NewLine);