Modify iExposure

Manoes

Newbie
Nov 10, 2016
8
1
3
39
Hi everybody., It's feel great that I've landed one of a best trading learning site. I've made some modification in iExposure to view average order taken price (included commission + swap)

MQL4:
if(type==OP_BUY)
        {
         ExtSymbolsSummaries[index][BUY_LOTS]+=OrderLots();
         ExtSymbolsSummaries[index][BUY_PRICE]+=(OrderOpenPrice()*OrderLots()-(OrderCommission()*Point+OrderSwap()*Point))+Point*0.01;
        }
      else
        {
         ExtSymbolsSummaries[index][SELL_LOTS]+=OrderLots();
         ExtSymbolsSummaries[index][SELL_PRICE]+=(OrderOpenPrice()*OrderLots()+(OrderCommission()*Point+OrderSwap()*Point))-Point*0.01;
        }


but the problem is when i see the average price in other chart window, which is not currently order opened, it shows wrong value.. sorry for my bad english.. here is the example that you can understand.,

If I took XAUUSD 0.01 lot 3 times., and if i add that i exposure indicator in EURUSD or GBPJPY (any other counters) charts, it shows wrong average price. but when i add that iExposure in XAUUSD chart shows perfect value,

Kindly some one code for me to have the exact average price while i adding that indicator to any window.,

PS: I know the "Point" is not good to use to see the exact average price in any price chart., I don't know what parameter i can use .,
 
Last edited by a moderator: