[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 347

 
Saturday too?
 
Is there a function that determines the magik of the last closed order in the history ?
 
7erj:
Is there a function that determines the magik of the last closed order in the history?
Find the order with the longest closing time in the history. The function OrderMagicNumber() will return its magic number.
 
Hello! The indicator draws channels and opens a trade when they are broken. My question is, how do I write a channel line in the breakdown condition?
 
skyjet:
Hello! The indicator draws channels and opens a trade when they are broken. My question is, how do I write a channel line in the breakdown condition?
The indicator draws through its buffers. Check the value of the buffer you need via iCustom().
 
artmedia70:
The indicator draws via its buffers. Check via iCustom() the value of the correct buffer.
And if the channel buffer is set to Buffer[0], then this is the last value of the channel and it can be compared with the real price?
if(Buffer[0] > Bid)
 {
  OrderSend...
 
skyjet:
And if the channel buffer is set to Buffer[0], that is the last value of the channel and it can be compared with the real price?

The indicator does not trade. It puts data on the chart through its buffers (not always and not necessarily). It is the Expert Advisor that trades. In order to know the data of the required indicator buffer in the Expert Advisor, you need to extract the data of the required indicator buffer to some variable using the iCustom() function. In the indicator settings (when you put it on the chart), you can find out the number of the buffer you need. Each indicator buffer has its own number (starting from zero) and colour.

And then you check the value of this variable for intersection (not like in your question - you have the comparison for more)

For example: You save the value of the needed buffer in two variables - the value on the first bar into one variable, and the value on the second bar into another variable. This is how you check. If the price value on the second bar is less than or equal to the value of the second variable and the price value on the first bar is greater than the value of the first variable, this means we have an upward crossover. The price value, for simplicity, can be expressed by the МА scale with period 1 and be compared with it.

There are a lot of ways to check for crossovers - this is the simplest one.

 
Is there a custom function that determines the magik of the last closed order in the history ?
 
7erj:
Is there a custom function that returns the magic number of the last closed order in the history?

Take two: Find the order with the longest closing time in the history. OrderMagicNumber() will return its magik.

Or should I write it for you?

 
artmedia70:

The indicator does not trade. It puts data on the chart through its buffers (not always and not necessarily). It is the Expert Advisor that trades. In order to know the data of the required indicator buffer in the Expert Advisor, you need to extract the data of the required indicator buffer to some variable using the iCustom() function. In the indicator settings (when you put it on the chart), you can find out the number of the buffer you need. Each indicator buffer has its own number (starting from zero) and colour.

And then you check the value of this variable for intersection (not like in your question - you have the comparison for more)

For example: You save the value of the needed buffer in two variables - the value on the first bar into one variable, and the value on the second bar into another variable. This is how you check. If the price value on the second bar is less than or equal to the value of the second variable and the price value on the first bar is greater than the value of the first variable, this means we have an upward crossover. The price value, for simplicity, can be expressed by the МА scale with period 1 and be compared with it.

There are many ways to check for a crossover - this is the easiest one.

Thank you very much for such a detailed reply!
Reason: