Code Help

Moderator: moderators

mtbBend
rank: <50 posts
rank: <50 posts
Posts: 1
Joined: Tue Oct 03, 2017 10:12 pm
Reputation: 0
Gender: None specified

Code Help

Postby mtbBend » Tue Oct 03, 2017 10:24 pm

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)

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

Return to “MetaTrader”