EA: Miscellaneous Questions - Trading Strategy - page 3

 

I fixed it with below code.

if( Hour() <= 10 || Hour() > 20 ) return;
 

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 Stop
    for ( 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() );
        else Print( "order modified successfully." );
    }
}

Strategy Tester Trailing Stop

 
        if  ( Bid < OrderOpenPrice() + OrderSwap() + OrderCommission() + distance ) continue;
What does Bid (1.12345) have to do with profit ($1000)
 
whroeder1:
What does Bid (1.12345) have to do with profit ($1000)

Now it works good.

Thanks for your nice question.

if  ( Bid < OrderOpenPrice() + OrderSwap() + OrderCommission() + distance * Point ) continue;
 

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?
 
Marco vd Heijden:
can you illustrate a bit more the problem please?

Yes, of course.

Thanks in advance.

indicator example chart 07

 
Haha well you have to find and fix the code that puts the dot there ...
 
Marco vd Heijden:
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 ?

Reason: