Modification in iexposure - page 2

 
deVries:

this comment makes my day great.....


ok dude. how much will it cost?..
 
d.saravana21:


ok dude. how much will it cost?..


Why not make an attempt for learning ???

here we help coders to learn themselves basics of coding if they really want to make mq4 programs themselves

Open a Job at Jobs if you want me or someone else to make it for you and not do make an attempt

there you can ask this question...

 
deVries:


Why not make an attempt for learning ???

here we help coders to learn themselves basics of coding if they really want to make mq4 programs themselves

Open a Job at Jobs if you want me or someone else to make it for you and not do make an attempt

there you can ask this question...


Thank you devries for pushing me to learn something..


I changed the following code section but it shows exact result only i added the iexposure in the symbol which i opened order.

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

for example if i bought 0.10 lot in EURUSD and added i exposure in Gold chart it's not showing exact result but.. if i added the iexposure in EURUSD shows exact result..

i'm extremely sorry for my bad english.

with regards

Saravana

 
d.saravana21:

dear mt4 coders

I would like to get modified iexposure.

the normal i exposure shows average buy or sell price without commission and swap. but i would like to modify the buy or sell price with commission and swaps(look like break even point).

I tried with my knowledge but i didn't get success. kindly some one help me.


this is look like the situation you have

you open a trade and as you see here the breakevenprice is something else then the average price

we have to pay for every trade spread and it might be we pay commission and swap for the trade running

so first to know is what do we want to see new exposure is gonna show....

then we look to the code of the old exposure and see what is this coding doing now...

Start with beginning

Tell me first what do we want to see new exposure is gonna show....

how do you like the coloms ...

what has it to calculate ...

something else ......

 
deVries:


this is look like the situation you have

you open a trade and as you see here the breakevenprice is something else then the average price

we have to pay for every trade spread and it might be we pay commission and swap for the trade running

so first to know is what do we want to see new exposure is gonna show....

then we look to the code of the old exposure and see what is this coding doing now...

Start with beginning

Tell me first what do we want to see new exposure is gonna show....

how do you like the coloms ...

what has it to calculate ...

something else ......



Thank you so much for the reply bro...

I just modified myself.. here is the screen shot..


but the problem is it shows exact result only on added in the currently open order symbol chart.. in my screen shot, if i add the i exposure in EURUSD it shows different value..

 
d.saravana21:


Thank you so much for the reply bro...

I just modified myself.. here is the screen shot..


but the problem is it shows exact result only on added in the currently open order symbol chart.. in my screen shot, if i add the i exposure in EURUSD it shows different value..



Did you use ..... hint PipsProfitPerLot = openprofit/PipValuePerLot(Symbol());

...... PipsProfit = PipsProfitPerLot/ lotsopen;

I need to see how you tried to place it inside the new Exposure

Use the SRC button to show that code...

 
deVries:

Did you use ..... hint PipsProfitPerLot = openprofit/PipValuePerLot(Symbol());

...... PipsProfit = PipsProfitPerLot/ lotsopen;

I need to see how you tried to place it inside the new Exposure

Use the SRC button to show that code...


Sure bro...


Here is what i'd modified..

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;
        }
 


deVries
:


calculate profit with commission an swap

for sell + selllotstotal

for buy + buylotstotal

(and if you go further for buy and sell together) then also nettolots calculation ( if profit != 0 and nettolots == 0 then there is no breakevenpoint to calculate )

calculate pointvalue per point

and you can calculate your level



Calculate (for sell and) for buy the profit .... with

BuyProfit = BuyProfit + OrderProfit() + OrderCommission() + OrderSwap();

for sell + selllotstotal

for buy + buylotstotal

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;
        }

now you can calculate pointvalue per point

See the function on first page

with every point difference the buyprofit will change ...... depending on the buylots how much

and you can calculate at what level the buyprofit will be 0.00 that level is breakeven buylevel

 
deVries:


Calculate (for sell and) for buy the profit .... with

for sell + selllotstotal

for buy + buylotstotal

now you can calculate pointvalue per point

See the function on first page

with every point difference the buyprofit will change ...... depending on the buylots how much

and you can calculate at what level the buyprofit will be 0.00 that level is breakeven buylevel


Thank you so much dude... thank you for the well explained guide...
Reason: