int start()
{
if (OrdersTotal()==0 && Open>Bid)
OrderSend (Symbol(),OP_SELL,Lots,Ask,3,Bid+150*Point,Bid-150*Point,0,Red);//Если пятизначные котировки, тройку измените на 30 if(OrderSelect(OrdersTotal()-1, SELECT_BY_POS, MODE_TRADES))
if (Bid-(Bid+150*Point)<-150)//От бид отнимаем бид? Упрощаем выражение и от бида вообще ничего не осталось, т.е. так if(150*Point<-150) ?
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid+150*Point,Bid-150*Point,0,Red);
}
}
There we take a stop loss from bid, and if the difference is less than -150, then OrderModify should move the spol-loss to follow the price, but it doesn't happen)
Hello, I have MT4 of one brokerage company and MT4 of another one. i transferred servers (.srv) in the folder \Program Files\MetaTrader 4\config no problem, but with MT4 and MT4Multiterminal (different brokerage companies too) does not work......
I changed my IP in .srv/I tried many DTs/I tried renaming/It DOES NOT work................ACK. INACTIVE AND NO GRAPH
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.
Yes, that's exactly the problem, I don't know how to do a day or hour sweep. PERIOD_D1 will select a new day, but how to extract the time?
I also tried a specific time assignment to do D'00:00:00', in the handbook says that you can, but somehow it did not work?
I have shown how to select the opening time of the day
I have a problem.
I want to draw some lines in the EA during testing, particularly in the indicator Accumulation/Distribution
In the program module this indicator is called
...
double myAD = iAD(Symbol(), 0, 1);
...
The problem itself is
...
int iWin_IDx = WindowFind("A/D");
...
- does not find the window of the indicator, in this case iWin_IDx=-1;
Tried inserting code into init() function result is the same
The WindowsTotal() function returns 1, thus showing that there is only one window, the currency quote window.
I think the problem is that the indicator window appears after EA execution - how to make it appear before test execution.
Doesn't seem to want to, gives error 138( Trying to trailing)
138 - New prices(requotes)
In your code
Thank you, I really should have put 30 there. But OrderModify doesn't work for some reason, stop-loss should move after the price.
Because the condition if (150*Point<-150) is not fulfilled.
Well, it does, but it doesn't work)
Do you have a Point negative value, less than -1? In any other case, the condition is not feasible.
And even in the first case, the condition fails - Point is a predefined variable and you can't assign its value (including a negative one).
--------
Conclusion: your condition is impossible to fulfill :)
Hello, I have MT4 of one brokerage company and MT4 of another one. i transferred servers (.srv) in the folder \Program Files\MetaTrader 4\config no problem, but with MT4 and MT4Multiterminal (different brokerage companies too) does not work......
I changed my IP in .srv/I tried many DTs/I tried renaming/It DOES NOT work................ACK. INACTIVE AND NO GRAPH
how to do it??????
I showed you how to choose the opening time of the day
I have a problem.
I want to draw some lines in the EA during testing, particularly in the indicator Accumulation/Distribution
In the program module this indicator is called
...
double myAD = iAD(Symbol(), 0, 1);
...
The problem itself is
...
int iWin_IDx = WindowFind("A/D");
...
- does not find the window of the indicator, in this case iWin_IDx=-1;
Tried inserting code into init() function, the result is the same
The WindowsTotal() function returns 1, thus showing that there is only one window, the currency quote window.
I think the problem is that the indicator window appears after EA execution - how to make it appear before test execution.