Need Help Convert TradeStation to Amibroker

#1
I need help convert this TradeStation codes to Amibroker please...

Here is the TradeStation codes:

Code:
Input: period(8);

Condition1 = close > value1 ;
Condition2 = close < value1 ;

{ OPTIONAL STEP: Replace HIGH and LOW with your own formulas for the high and low 
  prices of the PaintBar.  Note that Value1 and Value2 are numeric variables, temporary 
  holding places for the results of the numeric formulas. }

Value1 = average(close,8)[3] ;
Value2 = 10925 ;

{ Leave the following as is.  The plot is not named because there is only one PaintBar 
  plot - with two sub-plots - and the default names Plot1, Plot2 will be adequate.  The 
  alert does not include a description because the alerting criteria and the plotting 
  criteria are the same, and the description will be redundant. }

if Condition1 then
	begin
	PlotPaintBar( high, low, open, close, "range", Blue, default, 3  ) ;
	end ;
if condition2 then
	begin
		PlotPaintBar( high, low, open, close, "range", Red, default, 3  ) ;
	Alert ;

	end ;
	


	plot5(value1,"TTWHA");
Code:
[LegacyColorValue = true]; 

inputs: Price(Close), Length(10), BarsBack(3), UpColor(blue), DownColor(red),Displace( 0 ) ; 
var: AvgExp( 0 ); 

AvgExp = XAverage( Price, Length ) ; 

if AvgExp > AvgExp[BarsBack] then setplotcolor(1,UpColor); 
if AvgExp < AvgExp[BarsBack] then setplotcolor(1,DownColor); 


Plot1[Displace]( AvgExp, "AvgExp" ) ;
 
#2
I tried to convert it by myself but is this correct?

Code:
_SECTION_BEGIN("XAverage");
Length = 10;
AvgExp = AMA( C, 2 / (Length + 1 ) );
ColMa=IIf(AvgExp > Ref(AvgExp,-3) ,colorBlue,colorRed);

Plot(AvgExp,"MA1",ColMa,styleThick,styleLine);
_SECTION_END();

_SECTION_BEGIN("Heiken Ashi");
Value1 = MA(C,8);

HaClose = (O + H + L + C)/4;
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
xDiff = (HaHigh - Halow) * 10000;
SetBarFillColor(IIf(HaClose>HaOpen,colorBlue,colorRed));
Cancolor = IIf(HaClose > Value1,colorBlue,colorRed);
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "", Cancolor, styleCandle );
_SECTION_END();
 

Similar threads