Download MetaTrader 5

Seek a method of differing two situations

To add comments, please log in or register
The Market has more than 400 indicators. Try any of them!
Fa Cao
1141
Fa Cao 2013.12.19 07:02 

I made an Indicator which can draw a line on chart as below; some time this line cross the bars around it and some time this line always run above / below bars as below:

the first situation:

the second situation:

So I want to get a good method of differing these two situations.

Ubzen
5394
Ubzen 2013.12.19 09:42  
vx0532:I made an Indicator which can draw a line on chart as below; some time this line cross the bars around it and some time this line always run above / below bars as below: the first situation: the second situation: So I want to get a good method of differing these two situations.
If( Bid>iCustom() ) doesn't work for you?
whroeder1
14518
whroeder1 2013.12.19 14:03  
vx0532:I made an Indicator which can draw a line on chart as below; some time this line cross the bars around it and some time this line always run above / below bars as below:

The line does NOT "always run above" so your question can not be answered. You must come up with a specific definition. Then coding it is easy.

  • Bid > iCustom
  • ma - iCustom > x
  • last cross > n Bars
Ian Venner
2584
Ian Venner 2013.12.19 19:54  

You just need to look at them and ask the question what is different about the 2 situations ?

In situation 1 the price meanders above and below the indicator, in situation 2 the price makes a sudden large move a long way from the indicator, the indicator is slow to repond to that large move so it remains some distance below the price for some time afterwards. A large move in a short time is the cause of the difference.

Fa Cao
1141
Fa Cao 2013.12.20 02:10  

I know your meanings, thank you all.

but what i means is that I want to confirm it was just a "random wave" or a "Up/Down trend" for the past bars by computing this line and bars' price.

I know there must be many methods to do this, now I post here for a better or most commonly used method to execute it .

Thanks!

To add comments, please log in or register