Could anyone help me please?
i want to find two points in sequence: min1 and max1. But i want to represent, with the plot, max1 only if it is higher than min1 ( max1 > min1 ); in the contrary case ( if max1 < min1 ) i want that nothing it is represent, both min1 and max1. How can i do this? Why the code i try to write doesn't do this? Where am i wrong?
Code: Select all
inputs: Price ( Low ), Price1 ( High ), RightStrength ( 3 ), LeftStrength ( 3 );
vars: var0 ( 0 ), var1 ( 0 ), min2 ( 0 ), hold ( 0 );
Array: EArray[2](0);
condition1=hold=0 or hold=2;
condition2=hold=0 or hold=1;
var0 = PivotHighVSBar( 1, Price1, LeftStrength, RightStrength, RightStrength + 1 ) ;
var1 = PivotLowVSBar( 1, Price, LeftStrength, RightStrength, RightStrength + 1 ) ;
if var1 <> -1 and condition1 then
begin
min1 = Low;
EArray[1]=min1;
Plot1[RightStrength]( Low[RightStrength], "min1");
print(EArray[1]);
hold = 1;
end
else
min1 = 0;
EArray[1]=0;
NoPLot ( 1 );
//hold=0;
if condition2 then
max1 = High;
if (max1 > min1 and var0 <> -1) then
begin
EArray[2]=max1;
Plot2[RightStrength]( High[RightStrength], "max1");
print(EArray[2]);
hold=2;
end
else
max1=0;
EArray[2]=0;
EArray[1]=0;
min1 = 0;
NoPlot ( 2 );
//hold=0;