Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I have the following if statement to be entered when the target profit is 50 pips (500 for 5 decimal systems).
I can't get the value to exceed 500, am I doing something wrong with the *Point part?
if (OrderType() == OP_BUY && (Bid-OrderOpenPrice())*Point >= 500 )
{
//...do code
}
In my debugging, as soon as I multiply it by *Point it comes out as 0.00000
eg
Print ("not in modificationBUY: Bid-OO=" + DoubleToStr(MathAbs(Bid-OrderOpenPrice()),5)); //debug
Print ("not in modificationBUY: Bid-OO*Point=" + DoubleToStr(MathAbs((Bid-OrderOpenPrice())*Point),5)); //debug
prints 0.00960 (96 pips)
prints 0.00000
FULL CODE:
for(int i=0;i<OrdersTotal();i++)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==Symbol())
{
Print ("Order:" + OrderTicket() + ", OT: " + OrderType()); //debug
Print ("not in modificationBUY: Bid-OO=" + DoubleToStr(MathAbs(Bid-OrderOpenPrice()),5)); //debug
Print ("not in modificationBUY: Bid-OO*Point=" + DoubleToStr(MathAbs((Bid-OrderOpenPrice())*Point),5)); //debug
if (OrderType() == OP_BUY && (Bid-OrderOpenPrice())*Point >= 500 ) { //50pips profit at least before we modify //&& (
etc.....