I need help convert this TradeStation codes to Amibroker please...
Here is the TradeStation codes:
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" ) ;