거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Twitter에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
지표

daily drawdown - MetaTrader 5용 지표

kambiz shahriarynasab
게시자:
Kambiz Shahriarynasab
조회수:
12586
평가:
(19)
게시됨:
2022.11.07 07:26
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

In the lower right corner of the page, you can see the profit or loss percentage of your account.



OnInit():

   CreateEdit("Daily DD",200,68,98,30,"Daily DD",clrWhite,clrBlack,12);
   CreateEdit("Daily DD V",100,68,98,30,"",clrWhite,clrBlack,12);


OnDeinit:

   ObjectDelete(0,"Daily DD");
   ObjectDelete(0,"Daily DD V");


OnCalculate:

   MqlDateTime w;
   TimeToStruct(TimeCurrent(),w);
   string md=IntegerToString(w.year)+"."+IntegerToString(w.mon)+".01";
   double historyProfit=0,deposit=0;
   HistorySelect(0,TimeCurrent());
   ulong ticket_history_deal=0;
   for(int i=0; i<HistoryDealsTotal(); i++)
      if((ticket_history_deal=HistoryDealGetTicket(i))>0)
        {
         datetime timeeee=(datetime)HistoryDealGetInteger(ticket_history_deal,DEAL_TIME);
         if(timeeee>StringToTime(TimeToString(TimeCurrent(),TIME_DATE)))
            if(HistoryDealGetInteger(ticket_history_deal,DEAL_TYPE)==DEAL_TYPE_BUY || HistoryDealGetInteger(ticket_history_deal,DEAL_TYPE)==DEAL_TYPE_SELL)
               historyProfit+=HistoryDealGetDouble(ticket_history_deal,DEAL_PROFIT)+HistoryDealGetDouble(ticket_history_deal,DEAL_COMMISSION)+HistoryDealGetDouble(ticket_history_deal,DEAL_SWAP);
            else
               deposit+=HistoryDealGetDouble(ticket_history_deal,DEAL_PROFIT);
        }
   double startBalnce=AccountInfoDouble(ACCOUNT_BALANCE)-historyProfit;
   string text="";
   double dd=(historyProfit+AccountInfoDouble(ACCOUNT_PROFIT))*100/startBalnce;
   text=DoubleToString(dd,2)+" %";
   ObjectSetString(0,"Daily DD V",OBJPROP_TEXT,text);
   ChartRedraw();



HLC Trend confirmation indicator HLC Trend confirmation indicator

Confirmation (trend) indicator used for lower timeframes

ATR Stop Loss bands ATR Stop Loss bands

Money-managing stop loss baseline indicator for MT5.

Daily Profit Function Daily Profit Function

A simple and easy to understand function that calculates todays profit, written to the Expert Journal.

BSI Trend and Channel BSI Trend and Channel

This indicator shows trend line and channels using the BSI Indicator. Original work of https://www.mql5.com/en/code/13615