Im breaking down the Martingale Library to understand how it works yet its not based on if a trade is loss double up. from my understanding so far
double cl=HistoryOrderGetDouble(HistoryOrderGetTicket(HistoryOrdersTotal()-1),ORDER_PRICE_OPEN); //Double Because of ORDER_PRICE_OPEN double op=HistoryOrderGetDouble(HistoryOrderGetTicket(HistoryOrdersTotal()-2),ORDER_PRICE_OPEN); //Double Because of ORDER_PRICE_OPEN //Get the Properties in (Ticket History (list of order history () second from the last ), long typeor=HistoryOrderGetInteger(HistoryOrderGetTicket(HistoryOrdersTotal()-2),ORDER_TYPE); // HistoryOrderGetInterger Because of OrderType if(typeor==ORDER_TYPE_BUY) { if(op>cl) { if(ud<DoublingCount) { lt1=HistoryOrderGetDouble(HistoryOrderGetTicket(HistoryOrdersTotal()-2),ORDER_VOLUME_INITIAL)*2; //Double Because of Order Volume Initial ud++; } else ud=0; } else ud=0; }
just if the 2nd to last order open price is greater than the last order open price.
Oh.. Let Me Switch to History Deal I read your post and thought your where talking about
HistorySelect(0,TimeCurrent()); // request trade history
Im breaking down the Martingale Library to understand how it works yet its not based on if a trade is loss double up. from my understanding so far
just if the 2nd to last order open price is greater than the last order open price.
Oh.. Let Me Switch to History Deal I read your post and thought your where talking about
Yes I am talking about HistorySelect(). You always have to select your history before using HistoryXXX functions.
It wont print the profit, thus no comparison is possible
void ScanClosedTrades() { HistorySelect(0,TimeCurrent()); ulong ticket = 0; double profit; uint dealsTotal=HistoryDealsTotal(); //--- Loop for tracking wins losses and lot sizes for trading for (uint i=0; i < dealsTotal; i++) { if((ticket=HistoryDealGetTicket(i))>0) { profit=HistoryDealGetDouble(ticket,DEAL_PROFIT); } if (profit < 0) { Print("Profit: %f",CheckProfit);//profit); } }

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I can check the open price
I can not get the close price to compare them.