20-days High and 20-Days Low Indicator

#11
Hi Kenny,
This is different from what you asked earlier. Earlier you asked for almost a gap against the highest high value and lowest low value for a said period say 20 days.

This one is simple

Formula 1. For Green Colored Bars H>=HHV(H,20)

Formula 2. For Red Colored Bars L<=LLV(L,20)

Please don't club both and make a single indicator.

Keep them as they are.

For Green Scenario

Go to Expert Advisor - Click on New - Name it - Choose Highlights Tab - Click on New -

You will get Expert Highlight Editor wizard.

If you want you can name it.

Here you choose the color Green and copy the Formula 1

Click OK

Then again click on new in the highlights tab. This time choose Red color and copy Formula 2 here and click OK.

Then say OK and open a price chart and click on "Attach" - only once. Here don't click two times. Generally people make this mistake in the beginning.

After clicking on "Attach" just close Expert Advisor.

You will find the expert attached.

Please follow this and try doing it. If you have any trouble, please come back.

Happy practicing technicals

Ajayakumar
Wows. Many thanks Ajayakumar. It works. I learn a lot from you. I would like to expand to do the following :

I like to change the price color bars into 4 types depending on the following criteria.

If we starts from the left of the chart to the right :

a. If conditions 20SMA>50SMA>100SMA . If the price closed above the 20SMA, from then on change the price bar to green. It will remain green till the price bar touches the 50SMA. Once the price touches the 50SMA, the price bar will change to black. It will change back to green, the price bar closed above the 50SMA. The process will repeat.

b. If conditions 20SMA>50SMA>100SMA,200SMA. If the price closed above the 20SMA, from then on change the price bar to blue. It will remain blue till the price bar touches the 50SMA. Once the price touches the 50SMA, the price bar will change to black. It will change back to green, the price bar closed above the 50SMA. The process will repeat.

Between (a) and (b). When both conditions are met, preference of price color change will goes to (b).

c. If conditions is 20SMA<50SMA<100SMA<200SMA. If price closed below the 20SMA, from then on change the price bar to red. It will remain red till the price bar touches 50SMA, which will change the price bar color to black again.

Many thanks again. I must call you Mentor.
 

AJAY

Active Member
#12
Hi Kenny,

God / Nature is the only Mentor for everybody. No need to make a human being big.

I didn't understand whether you are asking me to give the formula for the said conditions or you are going to do it yourself and just sharing that here.

But in condition a at one point between 20SMA and 50SMA the bars should be blue in color. but once it touches 50SMA and closes above you want Green color bars. This is very difficult to achieve as in both the conditions price will be between 20SMA and 50SMA. You need to give extra load to metastock to get this. Still I doubt how far it will be feasible.

Please check it once again.

Happy practicing technicals

Ajayakumar
 
#13
Hi Kenny,

God / Nature is the only Mentor for everybody. No need to make a human being big.

I didn't understand whether you are asking me to give the formula for the said conditions or you are going to do it yourself and just sharing that here.

But in condition a at one point between 20SMA and 50SMA the bars should be blue in color. but once it touches 50SMA and closes above you want Green color bars. This is very difficult to achieve as in both the conditions price will be between 20SMA and 50SMA. You need to give extra load to metastock to get this. Still I doubt how far it will be feasible.

Please check it once again.

Happy practicing technicals

Ajayakumar
Hi Ajayakumar,

Here is the formula for the exploration of the stock counters meeting the following conditions:

Code:

{Col A When}
ma1:=mov(c,20,s);
ma2:=mov(c,50,s);
ma3:=mov(c,100,s);
ma4:=mov(c,200,s);
cond:=ma1>ma2 and ma2>ma3 and ma3>ma4 and c>ma2;
barssince(cond and Alert(cond=0,2));

{Filter}
ma1:=mov(c,20,s);
ma2:=mov(c,50,s);
ma3:=mov(c,100,s);
ma4:=mov(c,200,s);
cond:=ma1>ma2 and ma2>ma3 and ma3>ma4 and c>ma2;
cond and ColA>=0;


Could u guide me how I put this in the expert advisor to change the color of price bar if the conditions are met.

Thanks
 

Similar threads