You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.....