Calculate break even point on a trade

 

Can I get some help with the formula for calculating the break even point on a transaction? I need to consider all currency pairs and both buy or sell trade. I know how to identify the currency and the buy or sell, but what is the code snippet for determining the break even. So when a trave is entered, the profit value will start negative as the cost of the trade has been included. I want to be able to know when the price of the trade has reached the point where price is now at or above this negative value.

 

To define this better:


Pseudo:

if CurrentPrice >= OpenOrderPrice + CostOfTrade + NumOfPips

BreakEven = OpenOrderPrice+ CostOfTrade


I am looking for formula to determine CostOfTrade.

 

#16 is what you need to call and calculate for your trade parameteres


https://docs.mql4.com/constants/marketinfo

 
Liliput:

#16 is what you need to call and calculate for your trade parameteres


https://docs.mql4.com/constants/marketinfo

Let me make sure I have the right idea, let's assume the following:

{Buy scenario}

CurrentPrice = Ask

CostOfTrade = MarketInfo(MODE_TICKVALUE);

if CurrentPrice >= OpenOrderPrice + CostOfTrade + NumOfPips

BreakEven = OpenOrderPrice+ CostOfTrade


Isn't the deposit currency = the asking price? What am I missing?

 

Each open trade has a gain/loss value already available... OrderProfit().


For the whole account, AccountProfit() -- that is profit/loss of all open trades.

 
phy:


Each open trade has a gain/loss value already available... OrderProfit().


For the whole account, AccountProfit() -- that is profit/loss of all open trades.

No good, I am evaluating each order to determine when I break even on that order. If I break even I then adjust my stop loss margin. No, I don't want to use the standard trailing stop loss. Before I set that stop loss, I want to know that this order has paid it's expenses.


I am also concerned as to whether this covers the cost out as well as the cost in,. My guess us that cost in is the MarketInfo(MODE_TICKVALUE); in which case, I would want to factor in that price as well to cover exit.

Reason: