Trying to get the profit of the order just closed and add that to my previous TpAmount variable ... Would this work?
double ticket=OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderType()>=2 || OrderMagicNumber()!=MyMagic) continue;
Print("* Closing ... ",OrderSymbol(),". Ticket #"+IntegerToString(OrderTicket()) );
while (true)
{
ResetLastError();
if(OrderType()==OP_BUY)
ticket=OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Bid,Digits),3,clrBlue);
TpAmount+=(OrderProfit)
Code Help
Moderator: moderators
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.