Get syntax error, expecting 'bars'. Need your help!

jackyang1

Newbie
Messages
1
Likes
0
Code:
inputs:
Displace( 0 ) ;

variables:
HL( 0 ), Sew_O( 0 ), Sew_H( 0 ), Sew_L( 0 ), Sew_OHLC( 0 ), Sew_Next_O( 0 );


condition1 = Displace >= 0 or CurrentBar > AbsValue( Displace ) ;
if condition1 then
begin
HL = ( High + Low ) /2;
if Sew_O[1] >0 and HL[1] >0 then Sew_O = ( Sew_O[1] + HL[1] )/2 else Sew_O = HL ;

if High >= Sew_O than Sew_H = High else Sew_H = Sew_O ;
if Low < Sew_O than Sew_L = Low else Sew_L = Sew_O ;
Sew_HL = ( HL + Sew_H + Sew_L ) /3;
Sew_Next_O = ( ( Sew_O + HL[1])/2 + HL ) /2;
Plot1[Displace]( Sew_OHLC, "Sew_HL" ) ;
Plot2[Displace]( Sew_Next_O, "Sew_Next_O" ) ;
Plot3[Displace]( AverageFC( HL, 6)) ;


------ Compiled with error(s): ------
syntax error, expecting 'bars' ( the cursor stays on S of Sew_H = High )
errLine 14, errColumn 23, errLineEnd 14, errColumnEnd 23
causal study: (Function)


Thank you in advance.
 
HI jackyang1

The below code should work...
Code:
inputs: 
Displace( 0 ) ;

variables:
HL( 0 ), Sew_O( 0 ), Sew_H( 0 ), Sew_L( 0 ), Sew_OHLC( 0 ), Sew_Next_O( 0 );


condition1 = Displace >= 0 or CurrentBar > AbsValue( Displace ) ;
if condition1 then 
begin
HL = ( High + Low ) /2;
if Sew_O[1] >0 and HL[1] >0 then Sew_O = ( Sew_O[1] + HL[1] )/2 else Sew_O = HL ;

if High >= Sew_O [B]then[/B] Sew_H = High else Sew_H = Sew_O ;
if Low < Sew_O [B]then[/B] Sew_L = Low else Sew_L = Sew_O ;
Sew_OHLC = ( HL + Sew_H + Sew_L ) /3;                                     {OHLC rather HL}
Sew_Next_O = ( ( Sew_O + HL[1])/2 + HL ) /2;
End;

Plot1[Displace]( Sew_OHLC, "Sew_HL" ) ;
Plot2[Displace]( Sew_Next_O, "Sew_Next_O" ) ; 
Plot3[Displace]( AverageFC( HL, 6)) ;
Actually it's not "than" rather "then"

Good Luck..
 
Top