[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 96

 
PariaH:


SPY... But that's not it again :) the thing is, I don't use indicators... I just need to open a new order if a STOP or PREF is triggered! How can this be implemented in another way...

bool OrderMomentClose()     
{
  for (int i=OrdersHistoryTotal()-1; i>=0; i--)
  {
    if (!OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)) { ShowERROR(); continue; }
    if (OrderType()!=OP_BUY && OrderType()!=OP_SELL && OrderMagicNumber()!=magic && OrderSymbol()!=Symbol()) continue;
    if (OrderCloseTime()==Time[0] || OrderCloseTime()==Time[1]) return(true);
  }
return(false);
}
Here is a quick tip, it will return YES if the order has closed on the last 2 bars
 
Hi all. I'm having a problem with the "indulgers" again. They don't work. I have them in mt folder, in navigator in custom indicators they are visible, but when dragged to the chart nothing happens, no indicator or settings window for it appears. The button "indicators - custom" does not see them at all. Re-installation does not help. Please help.
 
alexhammer:
...I was just waiting to hear some ideas and suggestions, I'm not just trying to do it for myself.
Logically the following are required (for starters):
- BUY button
- SELL button
- Position selection>>Button (?) to close a position
- CLOSE ALL button
 
granit77:
They are logically asked (for a start):
- BUY button
- SELL button
- position selection>> button (?) to close the position
- CLOSE ALL button


I was just thinking about buttons. I couldn't decide how to make them, as mt4 has no such functions. So I came up with it by accident:

What if you draw a square in the bottom corner, and in the upper Arowami, for example, buttons, and then if you just move these buttons in this square, the coordinates will change and you can then determine that allegedly we have pressed a button, or you can do something simpler? I am still inventing an idea how to make pending orders. It is possible to do it in the same way as buttons, just drag them into a square and the line itself appears at a certain distance from the price.

The most annoying thing is that the screen redraws and blinks. How to overcome this trouble?

It already looks like this. Distances are calculated by themselves and the lines do not run off the screen (to the left). I have a good chance to check what order my stops and takei are to. Everything is already being processed, moved, and the orders are changing.

 
artmedia70:

Thanks for the tip :))))




 
alexhammer:


I have been thinking about such buttons. I just could not decide how to make them, because there are no such functions in mt4. And then I came up with it by accident:

What if you draw a square in the bottom corner, and in the upper Arowami, for example, buttons, and then if you just move these buttons in this square, the coordinates will change and you can then determine that allegedly we have pressed a button, or you can do something simpler? I am still inventing an idea how to make pending orders. It is possible to do it in the same way as buttons, just drag them into a square and the line itself appears at a certain distance from the price.

The most annoying thing is that the screen redraws and blinks. How to overcome this trouble?

It already looks like this. Distances are calculated by themselves and the lines do not run off the screen (to the left). I have a good chance to check what order my stops and takei are to. Everything is already being processed, moved, orders are being changed.

You disappoint me... Everybody knows that there are no buttons in MT4, but I was hoping that you didn't know that yet, so you'll come up with a fresh idea of how to make them :))
The method of checking coordinates by dragging an object has become a de facto standard and is often used in such Expert Advisors and scripts.
One of the basic methods - to open a position, the object is dragged from its standard position to the place of the future stop loss. The same way pendants are set.
I don't want to give links to a lot of visual trading scripts and Expert Advisors, in order not to inhibit the initiative, but they can be easily found in the database by searching.


All that said, this does not detract from the value of your solutions, which you came up with on your own.

 
coronel:

Found the history folder, opened it and there were 9 folders and one individual file. Deleted all the folders and the file, they were in the pre-cleaned bin. I opened the terminal and downloaded EURUSD, the download was successful. On reloading I got a "No new data" message. I open tester, put my Expert Advisor to optimize it for loaded currency. I have opened the Journal and saw the successful loading of the tester but no history data have been found and the hicnjry folder is empty, no new folder has been added to it. Where is the historical data that I downloaded stored? Why isn't the optimization going on, should I put all the erased folders back in the trash and throw out all the contents from the folders? Have I done everything right? Or more specifically, what should be the right thing to do when clearing the old and loading the new history? Your opinion?

 
boris.45:

When downloading, it sometimes says "No new data". Don't believe it and don't be discouraged.

Try to download again and again. Sometimes this happens with a bad Internet connection.

You will definitely succeed.

 

Does anyone have a function that determines the last day of the week. For the history test, of course, but it is hardly possible for the real one.

Or a pre-designed one?

 
ZZZEROXXX:

Does anyone have a function that determines the last day of the week. For the history test, of course, but it is hardly possible for the real one.

Or a pre-designed one?

Here: https://docs.mql4.com/ru/dateandtime/DayOfWeek
Reason: