how t o get Profit For Each Currency in MQL4?

how t o get Profit For Each Currency in MQL4?

Manage alerts

Loading saved threads...

Mohammad Hasanpoor · External communityPost link
External question — Stack Overflow Stack Exchange Author: Mohammad Hasanpoor Original post: https://stackoverflow.com/questions/75449179 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. How can I Comment The Profit And Numbr Of Trade For Each Currency from Trade History? for example in Screen , Show To me Like below Lines: EURUSD : Number Position = 5 , Profit = 31 $ GBPCAD : Number Position = 10 , Profit = -61 $ .... thank you for help
Quote
Report
Yasin İPEK · External communityPost link
External answer — Stack Overflow Stack Exchange Author: Yasin İPEK Original post: https://stackoverflow.com/a/75765754 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. //+------------------------------------------------------------------+ //| Ipek Bilgisayar.mq4 | //| Copyright 2023, MetaQuotes Ltd. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2023, MetaQuotes Ltd." #property link "https://www.mql5.com" #property version "1.00" #property strict double eurusd=0,gbpusd=0,usdchf=0; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void OnTick() { eurusd=KarHesapla("EURUSD"); gbpusd=KarHesapla("GBPUSD"); usdchf=KarHesapla("USDCHF"); EkranaYazdir(); } //+------------------------------------------------------------------+ void EkranaYazdir() { Comment("Ipek Bilgisayar", "\n","__________________________________", "\n","EURUSD \t:", eurusd, "\n","GBPUSD \t:", gbpusd, "\n","USDCHF \t:", usdchf ); } //+------------------------------------------------------------------+ double KarHesapla(string Sembol) { double _karToplam=0; for(int i = 0; i < OrdersHistoryTotal(); i++) { if(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) if(OrderSymbol() == Sembol) _karToplam+= OrderProfit()+OrderSwap()+OrderCommission(); } return _karToplam; } //+------------------------------------------------------------------+
Quote
Report

Post Reply

Quoted from Forex.com.bd-Editorial External question — Stack Overflow Stack Exchange Author: Mohammad Hasanpoor Source score (net votes, not local likes): 0 Original post: https://stackoverflow.com/questions/75449179 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. How can I Comment The Profit And Numbr Of Trade For Each Currency from Trade History? for example in Screen , Show To me Like below Lines: EURUSD : Number Position = 5 , Profit = 31 $ GBPCAD : Number Position = 10 , Profit = -61 $ .... thank you for help

Cancel quote

Checking account access…