[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 398

 
artmedia70:

1. What is the indicator value until it reaches 1.0000 ? Is it more or less than 1.0000 ?

2. What if indicator value is ALREADY 1.0000 when EA starts ?

3. what does it mean if the bar closes by falling?


1. The indicator value may be less or equal to 1.0000 (probably less)

2. Perform all conditions in order, having fulfilled the first one, do not check it with every tick. Also with other conditions

3. The open price of the bar will be greater than the close price. The bar will be some of the closed (unknown which one): 1,2,3,4,5,6,7,8,9, etc.

PS. All these conditions may not follow each other at once (may be in 1 hour, or 1:08, or 2, or 3, or 3:53, it is unknown), so we have to make it so as soon as the indicator reaches 1.0000, this condition is not checked at every tick anymore and we have to wait till one bar closes with fall and after that these 2 conditions are not checked at every tick and we wait till the indicator reaches 0.9980 or less. As soon as all conditions are fulfilled we open a market order to sell 0.1 lot with a stop loss of 100p and take profit of 400p.

 
kolyango:


1. Indicator value may be less or equal to 1.0000 (most likely less)

2. Perform all the conditions in order, once the first one has been fulfilled there is no need to check it at every tick. Also with other conditions

3. The open price of the bar will be higher than the close price. The bar will be any of the closed (unknown which one): 1,2,3,4,5,6,7,8,9 etc.

1. is it exactly equal? Or it may be less on the previous tick and more on the current one. In this case, the check for equality will not work. The same has happened with the check on bars. The second one is less, and the first one is greater, but not equal.

2. ........

The bar will be the first. We check it...

 

1. If the indicator value on the 0th bar has reached (i.e. has become equal to) 1.0000, this condition is no longer checked at every tick, but we check the second condition...

 
kolyango:

If the indicator value on the 0th bar has reached (i.e. has become equal to) 1.0000, this condition is no longer checked with every tick, but we check the second condition...

If it was lower on a previous tick, and has already become higher on the current tick? Then the indicator's value is considered reached 1.0000 ? I.e., check it for >=1.0000 ?
 
artmedia70:
If it was lower on the previous tick and is already higher on the current tick? Then is it considered that the indicator value has reached 1.0000 ? I.e. check for >=1.0000 ?

YES !
 

Yes, guys - that seems to be a long time for you...

2kolyango: IMHO, with such answers you're not ready to deal with information from my links by yourself...

You're interested that an indicator may have a value of 0.9998 on the previous bar, and on the next one - 1.0002 - in this case, the conditions of equality to 1.0000 indicator value will be skipped... If it's possible, then you have to use some tolerance with some value both up and down, for example, 0.0002, when you can conditionally believe that the indicator's value will be 1.0000 - as you wrote ... that's it, for starters.

 
Roman.:

Yes, guys - that seems to be a long time for you...

2kolyango: IMHO, with such answers you're not ready to deal with information from my links by yourself...

You're interested that an indicator may have a value of 0.9998 on the previous bar, and on the next one - 1.0002 - in this case, the conditions of equality to 1.0000 indicator value will be skipped... If it's possible, then you have to use some tolerance with some value up and down, for example, 0.0002, when we can conditionally assume that the value of this indicator will be equal to 1.0000 - as you wrote ... that's it, for starters.


If the indicator value is >= 1.0000, consider the first condition satisfied...
 
kolyango:

If indicator value will be >= 1.0000, then consider first condition fulfilled...

I understood this from the previous post, read the tutorial - working with flags, see my links.
 
Roman.:

Yes, guys - that seems to be a long time for you...

2kolyango: IMHO, with such answers you're not ready to deal with information from my links by yourself...

You're interested that an indicator may have a value of 0.9998 on the previous bar, and on the next one - 1.0002 - in this case, the conditions of equality to 1.0000 indicator value will be skipped... If it's possible, then you have to use some tolerance with some value up and down, for example, 0.0002, when we can conditionally assume that the value of this indicator will be equal to 1.0000 - as you wrote ... that's it, for starters.

What I was trying to figure out was whether it was worth writing code that wouldn't be understood anyway...

You have to go to a textbook first...

 
Roman.:

I got that from the previous post, read the tutorial - working with flags, see my links.

Your links I will definitely look at...

Criterion.mqh.

Writes the contents of the plugin and that's it, nothing opens or downloads!

Reason: