Below code does not work consistently. Sometimes works correctly sometimes not. I can't figure out. I already checked positions, all orders passes over 120 pips. ( 0.0012 for EURUSD ).
What can do for it, please? ( I am hard working on it )
Thanks in advance.
( I hope I will get answer soon )
void tradebuy()
{
int distance = 100;
// Trailing Stopfor ( int i = _OrdersTotal - 1; i >= 0; i-- )
{
if ( ! OrderSelect( i, SELECT_BY_POS ) ) continue;
if ( OrderOpenPrice() < OrderStopLoss() ) continue;
if ( OrderSymbol() != Symbol() ) continue;
if ( OrderType() != OP_BUY ) continue;
if ( Bid < OrderOpenPrice() + OrderSwap() + OrderCommission() + distance ) continue;
bool res = OrderModify( OrderTicket(), OrderOpenPrice(), OrderOpenPrice() + OrderSwap() + OrderCommission(), OrderTakeProfit(), 0, clrBlue );
if ( ! res ) Print( "error #", GetLastError() );
elsePrint( "order modified successfully." );
}
}
My Custom Indicator ( CI ) have Arrow Objects for Periods. When I call that my CI from my Trading Strategy then I see that Arrow Objects, but I do not want to see that Objects.
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 fixed it with below code.
Below code does not work consistently. Sometimes works correctly sometimes not. I can't figure out. I already checked positions, all orders passes over 120 pips. ( 0.0012 for EURUSD ).
What can do for it, please? ( I am hard working on it )
Thanks in advance.
( I hope I will get answer soon )
What does Bid (1.12345) have to do with profit ($1000)
Now it works good.
Thanks for your nice question.
My Custom Indicator ( CI ) have Arrow Objects for Periods. When I call that my CI from my Trading Strategy then I see that Arrow Objects, but I do not want to see that Objects.
Q: What can I do for it, please?
Thanks in advance.
can you illustrate a bit more the problem please?
Yes, of course.
Thanks in advance.
Haha well you have to find and fix the code that puts the dot there ...
Hehe! But my indicator works Perfectly. That issue only appear when I call that CI from Trading Strategy.
And I need to know what could I do for it, please?
It must be created somewhere so find it.
Maybe its a bug ?