Vucking good EA coder... https://t.ly/AZjRM
#14 All Time Return:
539.2%
Scripts for Limit entry, Stop entry, Market entry 46 replies
Exit is more important than the entry 59 replies
Newbie need help on trade entry and exit 4 replies
Exit is more important than the entry 16 replies
double entry_price = Open[0]; // or whatever you want it to be double exit_price = Close[0]; // or whatever you want it to be double volume_in_lots = 0.01; // microlot (or whatever lot size you want) string symbol = Symbol(); // or whatever symbol you want double profit_in_money = (exit_price - entry_price) / MarketInfo(symbol,MODE_POINT) * MarketInfo(symbol,MODE_TICKVALUE) * volume_in_lots;
Dislikeddouble entry_price = Open[0]; // or whatever you want it to be double exit_price = Close[0]; // or whatever you want it to be double volume_in_lots = 0.01; // microlot (or whatever lot size you want) string symbol = Symbol(); // or whatever symbol you want double profit_in_money = (exit_price - entry_price) / MarketInfo(symbol,MODE_POINT) * MarketInfo(symbol,MODE_TICKVALUE) * volume_in_lots; entry_price and exit_price can be any two price levels that you want to calculate the monetary value between. The above calculation should work universally....Ignored
PL = priceDiff / MODE_POINT / MODE_TICKSIZE * MODE_TICKVALUE * volume
Dislikeddouble entry_price = Open[0]; // or whatever you want it to be double exit_price = Close[0]; // or whatever you want it to be double volume_in_lots = 0.01; // microlot (or whatever lot size you want) string symbol = Symbol(); // or whatever symbol you want double profit_in_money = (exit_price - entry_price) / MarketInfo(symbol,MODE_POINT) * MarketInfo(symbol,MODE_TICKVALUE) * volume_in_lots; entry_price and exit_price can be any two price levels that you want to calculate the monetary value between. The above calculation should work universally....Ignored
DislikedPL = priceDiff / MODE_POINT / MODE_TICKSIZE * MODE_TICKVALUE * volumeIgnored
PL = priceDiff / MODE_TICKSIZE * MODE_TICKVALUE * volume
Disliked{quote} Thanks for the heads-up, but in that case I think your calculation should read: PL = priceDiff / MODE_TICKSIZE * MODE_TICKVALUE * volume Can you please confirm? Dividing by both POINT and TICKSIZE doesn't seem right to me. Although the inflated profit is appealing.Ignored
p = (OrderClosePrice()-OrderOpenPrice())*((MarketInfo(OrderSymbol(),MODE_TICKVALUE)/MarketInfo(OrderSymbol(),MODE_TICKSIZE)))*OrderLots();
Disliked{quote} Thanks for the heads-up, but in that case I think your calculation should read: PL = priceDiff / MODE_TICKSIZE * MODE_TICKVALUE * volume Can you please confirm? Dividing by both POINT and TICKSIZE doesn't seem right to me. Although the inflated profit is appealing.Ignored
Dislikedfor some reason i have never been able to get the individual components to always equal the order profit.... maybe 10% of the time its a couple pennies off..... quite possibly it's just a digit rounding issue..... below is the easy to read script..... maybe yall can see my error.... see if the 'o' and 'p' columns matchIgnored
DislikedI believe the reason for the small discrepancy between your columns O and P is that, whenever you are trading a pair XXXYYY, and YYY is a currency different to your account deposit currency (say ZZZ), then TICKVALUE changes as price moves, because it's used to convert YYY back to ZZZ, and the YYYZZZ exchange rate will have almost certainly changed between the opening and the closing of the position.Ignored