[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 295
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
Thanks. In principle, just replace "||" with "&&" (I probably wanted to check for inequality and then continue) and everything will work, but in the tester it will work anyway. Although, of course, your version will be more correct.
Well, these are nuances. I still try to rewrite it to suit my needs. I, for example, don't need medjic selection at all (in this function). Also I noticed that selection in function Figar0 was from the history list. The main thing here is to understand the idea. By the way, I need orders from the pool, so it all turned out much easier.
Thanks for the ideas and help, people.
PS: And please explain about
OrderType()>1
I've seen several times that OrderType is compared as int. What's the trick here? I thought it was a string variable.Well, these are nuances. I still try to rewrite it to suit my needs. I, for example, don't need medjic selection at all (in this function). Also I noticed that selection in function Figar0 was from the history list. The main thing here is to understand the idea. By the way, I need orders from the pool, so it all turned out much easier.
Thanks for the ideas and help, people.
PS: Could you explain the following?
I've seen OrderType compared as int a few times. What's the trick here? I thought it was a string variable.This is a correspondence between constants and their values.
OP_BUY corresponds to 0
OP_SELL corresponds to 1
__________________________________________________________________________________________________________-
Type of operation for the OrderSend() function. Can be any of the following values:
By the way, I need orders from the pool, so it turned out to be much simpler.
Therefore, if we need to select from a list of open orders, then we can omit specifying this parameter (it is set by default). If we want to choose from a list of closed orders, we should specify MODE_HISTORY as a parameter.
Accordingly, if you want to find the last open order, the loop is made on open orders of the terminal and you should also check the time of opening OrderOpenTime(), if you need the last closed order (as in the above examples), the loop should be made on closed orders of the terminal and you should check OrderCloseTime() to find out when the selected order was closed.
And for your reference, if you select by ticket, the parameter pool will be ignored at all and the order will be found in both lists. Once the order has been found, we must check its close time to find out which list the order has been selected from. If the time of closing is higher than zero, the order is closed and has been selected from the list of closed orders. If the time of closing of an open order is always equal to zero. So, if it is equal to zero, the order has been selected from the list of open orders.
Also, if you search for a pending order by its ticket, it can appear in both lists. This will happen if it is converted to a market order. Therefore you will also need to check the type of order you have chosen. And if the pending order is closed, and the market order with the same ticket is not closed, it means that the pending order has been transformed into a market order.
Thanks. In principle, just replace "||" with "&&" (I probably wanted to check for inequality and then continue) and everything will work, but in the tester it will work anyway. Although, of course, your version will be more correct.
Hello, I wanted to write an indicator that counts the MAX and MIN of the closing price for a certain period. Like all I do in the tutorial, but the old data is not drawn at all, it shows two horizontal lines with the current MAX and MIN. Can you tell me what I'm doing wrong?
minValueIdx= ArrayMinimum(Close,(period-1), i);
Otherwise you keep finding the same indexes at every step
Hi all! How to find out programmatically what type of variable belongs to: int OR double?
and secondly, what does the error "invalid double number as parameter 1 for DoubleToStr function" mean?
Hi all! How do I know the type of a variable: int OR double?
Valdemar 01.04.2011 16:31
Greetings to all masters of programming! Hint at the right idea, if you do not mind: Here I, say I decided at the end of a certain hour of trading, put a stop order, pushing away from the high and low of the hour on a few points, what I should use, write a programming function!