Could anyone help me please?
I'm trying to write a simple code that identifies the HighPoint and LowPoint, which must meet two conditions. When these points have been identified, I want to represent them in a way that there is an alternation between these points; that is, when it is represented a LowPoint, it must be followed by a HighPoint, without that there are other Low in the middle; and vice versa. And when i did it, i would to put the value in the Array.
I hope that someone can help me.
I attach the code.
Code: Select all
inputs: Price ( Low ), Price1 ( High ), RightStrenght ( 3 ) ;
vars: min1 ( 0 ), max1 ( 0 );
Array: EArray[2](0);
condition1 = Price[3]<Price[4] And Price[3]<Price[5] And Price[3]<Price[6] And Price[3]<Price[2] And Price[3]<Price[1] And Price[3]<Price;
condition2 = Price1[3]>Price1[4] And Price1[3]>Price1[5] And Price1[3]>Price1[6] And
Price1[3]>Price1[2] And Price1[3]>Price1[1] And Price1[3]>Price1;
if condition1 then
begin
min1 = Price[3];
EArray[1]=min1;
Plot1[RightStrenght]( EArray[1], "swing Low" );
print(EArray[1]);
end
else
min1=0;
EArray[1]=0;
NoPlot ( 1 );
if condition2 then
begin
max1 = Price1[3];
EArray[2]=max1;
Plot2[RightStrenght]( EArray[2], "swing High" );
print(EArray[2]);
end
else
max1=0;
EArray[2]=0;
min1 = 0;
NoPlot ( 1 );
NoPlot ( 2 );