Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1174
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
OrderSelect on the ticket has been made earlier. The order is pending. How to get the order to be marketable, other than by checking the order type on every tick. In the logs, this time is recorded, but it seems that the field for this time in the order structure is not provided, or am I wrong? When we change the order type, OrdersTotal() and OrdersHistoryTotal also don't change, if I understand correctly.
I think that everything else is somewhat clearer)
Have you tried OrderOpenTime? I do not even remember if it changes when a position is triggered.
I do not know when it is necessary to check if the pending order has triggered every tick(and not before key action or every 1...5 min), but MT4 has no other way.
In MT5 it's more convenient. In OTT you find out about the transaction, if you need to work with lists you do the processing in OTT
Good afternoon!
I am working on an owl on fractals. There is a problem. Help. The essence is this:
The script searches for the last top or bottom fractal from the last 100 candlesticks with variable [FractalsLimit=100;] and opens BUY position - if a fractal is broken through, and vice versa for SELL.
The last 100 candlesticks should be used to find the maximum or minimum fractals and open a position. It means, it focuses only on the maximal and minimal fractals, not on the last ones.
Have you tried OrderOpenTime? I don't remember if it changes when a pending order is triggered.
I don't know when it is necessary to check every tick(and not before key actions or every 1...5...minutes) if a pending order has triggered, but there is no other way to do it in MT4.
In MT5 it's more convenient. In OTT, you learn about conducting a transaction. If you need to work with lists, you will conduct processing in OTT.
OrderOpenTime shows the time of pending order opening. It's a question of understanding the operation more. So, the time is written to the log and the journal and is not shown anywhere else. Respectively, if we haven't fixed it, then we can view it later, according to the fact)))))
If I understand correctly, it will be opening of position / deal in MT5. Although I don't understand the division into order/trade/position as an optimal solution, but there is more data, of course.
it happens)) 1 gets very lost in the background of English letters l i etc., it is more convenient to call then suffixes 001, 2... etc.
I see what you mean) corrected the mistake, now the value of the second handle is 1,0. If you put a larger timeframe in the first handle than in the second handle, the value of the second handle is 0. Can you please tell me what else I need to fix to get the second handle value right?
OrderOpenTime shows the opening time of the pending order. It's a question of understanding the operation more. It turns out that the time is recorded in the log and the journal and is not reflected anywhere else. Accordingly, if we have not fixed it, then we can look later, according to the fact)))))
You have been bringing up this issue for a week. I offered to review the principles of placing orders in the trading strategy
but if this issue is important to you, it is not a problem to "fix" it with a readjustment of one tick.
If you want to try it, you'll have to do it with a certain speed, but if you don't have a real tick, you'll probably end up with a lot of errors, because the speed of placing pending orders is much higher.
What I would like to propose to study is theCArrayInt SB https://www.mql5.com/ru/docs/standardlibrary/datastructures/carrayint
in CArrayInt you will add tickets and this data type will allow you to easily delete "tickets which became marketable".
as I wrote above accuracy - 1 tick, the check code will be minimal
In MT5 it will be a position / trade opening, if I understand correctly. Although I don't understand the division to order / deal / position as an optimal solution, but there is more data of course.
If you can write for MT5 - then why are we discussing it? the platform is more powerful, the functionality is higher - comparing MT4 and MT5 makes no sense, MT4 is easier to enter, but MT5 has more features
You have been raising this issue since a week, I suggested you to reconsider the principles of placing orders in the trading strategy
I still do not understand. The strategy is of course different. The question comes from the fact that quite an important event is only reflected in the log. And no one directly answered that there is nowhere but the log of the time when an order became marketable))))
And the logic of the strategy does not depend on the terminal. If the logic is lame, then you can certainly make it up, but the limp will not go away))))
It remains unclear. The strategy is of course different. The question comes from the fact that a rather important event is only reflected in the log. And no one has directly answered that there is nowhere other than the log of the time when the order became market))))
no this information - nooooo!!!
importance... well it does matter to you, before that, how many years of writing strategies and how it worked, even in profit ;)
as a rule, do not place many pending orders, follow market orders, if necessary, add a pending order - pending orders become market orders
we use everything - averaging, pyramiding, orders grid and ... and lots... I do not remember these antics on traders forums, I haven't read them for more than a year now - I have more of my own thoughts than other people's )))
there is no such information - nooooo!!!
importance... well it is important to you, before that, how many years of writing a strategy and it would work, even in profit ;)
as a rule, you should not place many pending orders, follow the market orders, if necessary, add a pending order - pending orders become market orders
we use everything - averaging, pyramiding, orders grid and ... and lots... If you do not know, you should read these tricks on traders forums, I haven`t done it for more than a year - I`ve got more thoughts of my own than of others )))
Thanks))))
Martin and averaging is self-deception and prohibitive (because you can neither calculate nor predict the risk by the definition of BP properties))))) risk, which sometimes, but only sometimes, is justified))))
If the strategy is right, one order is enough))))
If the strategy is correct, one order is enough))))
If in your TS the number of orders is strictly set, then you should not have problems with determining what has happened to the pending orders on the current tick
Knowing the exact time will not give you anything - all information is received upon tick arrival - no tick, no information
Hello, I am facing a problem, how to change the parameters of a custom indicator in the EA. The problem is that when I change any parameter in the list of indicators, a new copy is created. When I go to the properties of these copies, each copy has its own parameter. The more I change the parameter, the more copies are created. I use it via iCustom.
For example:
#resource "\\Indicators\\\inicator.ex4"
extern Var1=1;
//------------------------------------------
void OnTick()
{
int A;
Var1++;
A=iCustom(Symbol(),PERIOD_CURRENT,"::Indicators\\\indicator",Var1,0,0);
As a result, we see in the list of indicators:
Indicator (with parameter Var1=2)
Indicator (with parameter Var1=3)
Indicator (with parameter Var1=4)
.... etc.