Hey all need some help here

#1
Hey Guys,
I need some smiple coding done plz

Criteria
1) A bar whose entire range exceeds the last 10 bars by at least 2.5 to 3 times
2) A bar that exceeds the previous bars range.

For condition 1 a green dot should appear under the bar
For condition 2 an orange dot should appear under the bar

The dot should be the same size as the ones used in the default SARs formula.
This should be a drag and drop formula, ie i drag it directly onto the price field.

Thanks in advance

Isabella:clap:
 
#3
2.5 to 3 times of what?

is it 3 times of last Average of 10 bar range or what ?

I will try to code but need to know
Hey Extremist,

Thank you for such a quick reply,

1) Lets consider the previous 10 bars
2) Each of those bars had a range of 3 points to 25 points
3) Now condition 1 is that this bar should be atleast 2.5 to 3 times ( in terms of points) the previous 10 bars, ie a sudden increase in number of points

Something like average true range I think.


Also

Can we have the arrows or dots offset below price bars

Thanks again,

Isa
 

extremist

Well-Known Member
#4
Hey Extremist,

Thank you for such a quick reply,

1) Lets consider the previous 10 bars
2) Each of those bars had a range of 3 points to 25 points
3) Now condition 1 is that this bar should be atleast 2.5 to 3 times ( in terms of points) the previous 10 bars, ie a sudden increase in number of points

Something like average true range I think.


Also

Can we have the arrows or dots offset below price bars

Thanks again,

Isa
Try this

Code:
condtn1 = ((H-L) > Ref(atr(10),-1)*2.5);
condtn2 = (H > Ref(H, -1)) OR (L < Ref(L, -1));

PlotShapes(condtn1, colorGreen);
PlotShapes(condtn2, colorOrange);
 
#5
Try this

Code:
condtn1 = ((H-L) > Ref(atr(10),-1)*2.5);
condtn2 = (H > Ref(H, -1)) OR (L < Ref(L, -1));

PlotShapes(condtn1, colorGreen);
PlotShapes(condtn2, colorOrange);

It works great Extremist;- Thank you for your kind help.

Small request, the shapes are arrows which are overlapping the price bar

1) can we offset them by x- distance below the bar
2) Instead of an arrow can we have a smiple hollow dot

Thanks Again

Isa
 
Last edited: