Simple_Profit_Loss_Perсentage

Author: Copyright 2023, MrBrooklin
0 Views
0 Downloads
0 Favorites
Simple_Profit_Loss_Perсentage
ÿþ//+------------------------------------------------------------------+

//|                                Simple_Profit_Loss_PerAentage.mq5 |

//|                                       Copyright 2023, MrBrooklin |

//|                         https://www.mql5.com/ru/users/mrbrooklin |

//+------------------------------------------------------------------+

#property copyright "Copyright 2023, MrBrooklin"

#property link      "https://www.mql5.com/ru/users/mrbrooklin"

#property version   "1.00"

//+------------------------------------------------------------------+

//| Expert initialization function                                   |

//+------------------------------------------------------------------+

int OnInit()

  {

   EventSetTimer(1);

   return(INIT_SUCCEEDED);

  }

//+------------------------------------------------------------------+

//| Expert deinitialization function                                 |

//+------------------------------------------------------------------+

void OnDeinit(const int reason)

  {

   EventKillTimer();

   Comment(""); // C40;8< :><<5=B0@89

  }

//+------------------------------------------------------------------+

//| Expert timer function                                            |

//+------------------------------------------------------------------+

void OnTimer()

  {

//--- >1JO28< ?5@5<5==CN 8 704048< D>@<C;C 4;O 2KG8A;5=8O B5:CI53> % ?@81K;8 8;8 C1KB:0

   double result_trade=AccountInfoDouble(ACCOUNT_EQUITY)*100/AccountInfoDouble(ACCOUNT_BALANCE)-100;

   double result_1=result_trade>=0 ? result_trade : 0; // >1JO28< ?5@5<5==CN ?@81K;8

   double result_2=result_trade<=0 ? result_trade : 0; // >1JO28< ?5@5<5==CN C1KB:0

//--- 2K2545< :><<5=B0@89

   Comment("\n","@81K;L = ",DoubleToString(result_1,2)," %","\n",

           "#1KB>:   = ",DoubleToString(result_2,2)," %");

  }

//+------------------------------------------------------------------+

Comments