Simple Coding Help - No Promise.

yasu222

Active Member
I require custom time alert (indication on chart) AFL or Exploration as per my time settings example -
if I set 1 hour , so after every hour one pop up should come-on as "new hour start" like that.
 
Last edited:
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
 
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
_SECTION_BEGIN("Give some name");
hhv10 = HHV(H, 10);
llv10 = LLV(L, 10);

// Replace OR with AND if you want both conditions to be met
condtn1 = (H > hhv10) OR (L < llv10);
condtn2 = (H > Ref(H, -1)) OR (L < Ref(L, -1));

PlotShapes(condtn1, colorGreen);
PlotShapes(condtn2, colorOrange);
_SECTION_END;
 
Hey Mastermind !!,
Thank you for such a quick reply,
Just wanted to point out that condition 2 works just as required (Thanks again)

Its condition 1 that I may have not explained correctly

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 offset below, since they are overlapping price in the current formula. (which is magnificent)

Thanks again,


Isa
 
Last edited:

extremist

Well-Known Member
Hey Mastermind !!,
Thank you for such a quick reply,
Just wanted to point out that condition 2 works just as required (Thanks again)

Its condition 1 that I may have not explained correctly

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 offset below, since they are overlapping price in the current formula. (which is magnificent)

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);
 
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);

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
 
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
4th and 5th parameter of PlotShapes control the precise vertical location of the shape. Experiment with it.

PlotShapes(condtn1 * shapeHollowCircle, colorGreen, 0, High, 12);

and so on....
 

yasu222

Active Member
I require custom time alert (indication on chart) AFL or Exploration as per my time settings example -
if I set 1 hour , so after every hour one pop up should come-on as "new hour start" like that.


I require custom time alert (indication on chart) AFL or Exploration as per my time settings.
Example -
if I set 1 hour in parameters then after every hour one pop up should come as "new hour start".
 

toughard

Well-Known Member
Dear all,

In this code only HH LH HL LL are getting plotted....
how to get the values also to get plotted along with them?

I tried ValueWhen function but could not do it properly... kindly help

Q = Param( "% Change", 0.05, 0.01, 10, 0.01 );
Z = Zig( C , q ) ;
HH = ( ( Z < Ref( Z, -1 ) AND Ref( Z, -1 ) > Ref( Z, -2 ) ) AND (Peak( z, q, 1 ) > Peak( Z, q, 2 ) ) );
LH = ( ( Z < Ref( Z, -1 ) AND Ref( Z, -1 ) > Ref( Z, -2 ) ) AND (Peak( Z, q, 1 ) < Peak( Z, q, 2 ) ) );
HL = ( ( Z > Ref( Z, -1 ) AND Ref( Z, -1 ) < Ref( Z, -2 ) ) AND (Trough( Z, q, 1 ) > Trough( Z, q, 2 ) ) );
LL = ( ( Z > Ref( Z, -1 ) AND Ref( Z, -1 ) < Ref( Z, -2 ) ) AND (Trough( Z, q, 1 ) < Trough( Z, q, 2 ) ) );
GraphXSpace = 5;
dist = 0.5 * ATR( 20 );

for ( i = 0; i < BarCount; i++ )
{

if ( HH )
PlotText( "HH", i, H[ i ] + dist, colorRed );

if ( LH )
PlotText( "LH", i, H[ i ] + dist, colorRed );

if ( HL )
PlotText( "HL", i, L[ i ] - dist, colorBrightGreen );

if ( LL )
PlotText( "LL", i, L[ i ] - dist, colorBrightGreen );
}
 
Last edited:

Similar threads