Amibroker 6 shows blank chart when formula applied....why does this happen

#1
I ve been using Amibroker 6.2 for quite some time and I ve noticed that many formulas when applied in amibroker displays only blank chart despite the formula is errors free and all the plot commands are properly coded.........I didnt face such problem with Ami5.7 which was a very stable version I believe.........does anyone know why this happens and am I the only one facing this problem...............below are few formulas with which I faced this blank chart problem..........


Filter = Close > 0.1;
Filter = Volume > 1;
i=0;

_SECTION_BEGIN("Aroon");
L14 = LLV( Low, 14 );
H14 = HHV( High, 14 );

AroonDn =
100* (14 - (( IIf(Ref(L,-1) == L14 ,1 , IIf( Ref(L ,-2 ) == L14 ,2 , IIf( Ref(L
,- 3 ) ==
L14 ,3 ,IIf( Ref(L ,-4 ) == L14 ,4 ,IIf(Ref( L ,-5 ) == L14 ,5 ,IIf(Ref(L ,-6 )
==
L14 ,6 ,IIf( Ref(L ,-7 ) == L14 ,7 ,IIf(Ref( L ,-8 ) == L14 ,8 ,IIf(Ref( L ,-9
) ==
L14 ,9 ,IIf( Ref(L,-10) == LLV(L,14 ) ,10 ,IIf(Ref(L ,-11) == L14 ,11
,IIf(Ref(L,-12 ) ==
LLV(L ,14) ,12,IIf( Ref(L,-13) == LLV(L ,14 ) ,13 ,IIf( Ref( L,-14) == L14 ,14
,0) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) / 14;

AroonUp =
100 * ( 14 - ( ( IIf(Ref(H ,-1) == H14 ,1 ,IIf(Ref(H ,-2 ) == H14 ,2 ,IIf(Ref(H
,- 3 ) ==
H14 ,3, IIf(Ref(H ,-4 ) == H14 ,4 ,IIf(Ref(H ,-5 ) == H14 ,5 ,IIf(Ref(H ,-6 )
==
H14 ,6 ,IIf(Ref(H,-7 ) == H14 ,7 ,IIf(Ref(H ,-8 ) == H14 ,8 , IIf(Ref(H ,-9 )
==
H14 ,9 ,IIf(Ref(H ,-10 ) == H14 ,10 ,IIf(Ref(H ,-11 ) == H14 ,11 ,IIf(Ref(H
,-12 ) ==
H14 ,12 ,IIf(Ref(H ,-13) == H14 ,13 ,IIf(Ref(H ,-14 ) == H14 ,14 ,0 ) ) ) ) ) )
) ) ) ) ) ) ) ) ) ) ) / 14;

PL = Param("PL",14,4,200,1);
ALen = PL;

AroonUp = 100 * (ALen - (HHVBars(H, ALen + 1))) / Alen;
AroonDn = 100 * (ALen - (LLVBars(L, ALen + 1))) / ALen;

Plot(AroonUp, "Aroon Up", ParamColor( "Color up", colorCycle ), ParamStyle("Style up"));
Plot(AroonDn, "Aroon Dn", ParamColor( "Color Dn", colorCycle ), ParamStyle("Style Dn"));

sa= Cross(AroonUp,AroonDn);
sb= Cross(AroonDn,AroonUp);

AroonOsc=AroonUp-AroonDn;
Aroon=AroonOsc>0;
IIf(Aroon,i+1,i);
AroonStatus=WriteIf(Aroon,"Bullish",WriteIf(IsNull(RSI(14)),"N/A","Bearish"));
AroonColor=IIf(Aroon,colorGreen,IIf(IsNull(RSI(14)),colorLightGrey,colorRed));
AddTextColumn(AroonStatus,"Aroon",1,colorWhite,AroonColor);

AddColumn(Volume,"Volume",1.0);
AddColumn(Close, "Close", 1.2);
AddColumn(Ref(Close,-1), "Prev-Cl", 1.2);

AddColumn(AroonUp,"AroonUp",1.2);
AddColumn(AroonDn,"AroonDn",1.2);
AddColumn(sa,"Aup Cross Adn",1.2);
AddColumn(sb,"Adn Cross Aup",1.2);

AddColumn(MACD(12, 26), "MACD", 1.2 );
AddColumn(StochD(15,3, 3), "Stoch", 1.2 );
AddColumn( RSI(15), "RSI", 1.2 );

_SECTION_END();



_SECTION_BEGIN("Fibo Pivots");

SetChartOptions(0,chartShowDates);
GraphXSpace=5;
Plot(C,"",colorBlack,styleCandle);

//by K.Vidyasagar, [email protected]
PH = DayH = TimeFrameGetPrice("H", inDaily, -1); DayHI = LastValue (DayH,1); // yesterdays high
PL = DayL = TimeFrameGetPrice("L", inDaily, -1); DayLI = LastValue (DayL,1); // yesterdays low
PC = DayC = TimeFrameGetPrice("C", inDaily, -1); // yesterdays close
PR = PH - PL;
//DayO = TimeFrameGetPrice("O", inDaily); // current day open

numbars = LastValue(Cum(Status("barvisible")));
hts = -33.5;
R=PH-PL;//range
P=(PH+PL+PC)/3; pI = LastValue (p,1);// Standard Pivot
fr1 = p + (R * 0.38); fr1I = LastValue (fr1,1);
fr2 = p + (R * 0.62); fr2I = LastValue (fr2,1);
fr3 = p + (R * 0.99); fr3I = LastValue (fr3,1);
fs1 = p - (R * 0.38); fs1I = LastValue (fs1,1);
fs2 = p - (R * 0.62); fs2I = LastValue (fs2,1);
fs3 = p - (R * 0.99); fs3I = LastValue (fs3,1);

Plot(p,"Pivot",colorBlue,styleDots|styleNoLine|styleNoRescale);
Plot(fr1,"R1",colorRed,styleDots|styleNoLine|styleNoRescale);
Plot(fr2,"R2",colorPink,styleDots|styleNoLine|styleNoRescale);
Plot(fr3,"R3",colorRose,styleDots|styleNoLine|styleNoRescale);
Plot(fs1,"S1",colorGreen,styleDots|styleNoLine|styleNoRescale);
Plot(fs2,"S2",colorLime,styleDots|styleNoLine|styleNoRescale);
Plot(fs3,"S3",colorPaleGreen,styleDots|styleNoLine|styleNoRescale);
PlotText(" Pivot ", LastValue(BarIndex())-(numbars/Hts), pI, colorBlue);
PlotText(" Fib R1 " , LastValue(BarIndex())-(numbars/Hts), fr1I, colorRed);
PlotText(" Fib R2 " , LastValue(BarIndex())-(numbars/Hts), fr2I, colorPink);
PlotText(" Fib R3 " , LastValue(BarIndex())-(numbars/Hts), fr3I, colorRose);
PlotText(" Fib S1 " , LastValue(BarIndex())-(numbars/Hts), fs1I, colorGreen);
PlotText(" Fib S2 " , LastValue(BarIndex())-(numbars/Hts), fs2I, colorLime);
PlotText(" Fib S3 " , LastValue(BarIndex())-(numbars/Hts), fs3I, colorPaleGreen);
_SECTION_END();




///Volume Based Intraday AFl for algo traders
///Created by Team Viatrades
///[email protected]
SetPositionSize(1, spsShares);
SetBarsRequired(sbrAll, sbrAll);

SetChartOptions(0,chartShowArrows|chartShowDates);
SetChartBkGradientFill(colorBlack,colorBlack,colorBlack);
SetBarFillColor(IIf(C>O,colorPaleBlue,IIf(C<=O,colorOrange,colorLightGrey)));
Plot(C,"\nPrice",IIf(C>O,colorPaleBlue,IIf(C<=O,colorOrange,colorLightGrey)),64|styleNoTitle,0,0,0,0);
GraphXSpace = 10;

// Time Given for MCX You can Change this
StartTime = ParamTime("Start Time", "10:00:00");
StopTime = ParamTime("End Time", "23:00:00");

Target = Param("Target %", 1, 0.1, 50, 0.01)/100;
StopLoss = Param("Stop Loss %", 0.6, 0.1, 50, 0.01)/100;


DCAL = DateNum();
HCAL = 0;
HCALPrice = 0;
LCALPrice = 0;
CurDNPrice = 0;
FirDNDNPrice = DCAL[0];
TN = TimeNum();
DT = DateTime();
LDT = DT[BarCount-1];

VOLPRICECAL = Null;
VOLLOWPRICECAL = Null;

HIGPRCCALC = Null;
LOWPRCCALC = Null;

PrevDay = 0;

for(i = 1; i < BarCount; i++)
{
if(CurDNPrice != DCAL && FirDNDNPrice != DCAL)
{
VOLPRICECAL = HCALPrice;
VOLLOWPRICECAL = LCALPrice;

CurDNPrice = DCAL;
HCAL = 0;
HCALPrice = 0;
LCALPrice = 0;
HIGPRCCALC[i-1] = Null;
LOWPRCCALC[i-1] = Null;
}

HIGPRCCALC = VOLPRICECAL;
LOWPRCCALC = VOLLOWPRICECAL;

if(HCAL < Volume)
{
HCAL = Volume;
HCALPrice = High;
LCALPrice = Low;
}
}


Plot(HIGPRCCALC, "Prev High", colorGrey50, styleStaircase|styleDashed);
Plot(LOWPRCCALC, "Prev Low", colorGrey50, styleStaircase|styleDashed);

Buy = Ref(Close > HIGPRCCALC, -1) AND TN > StartTime AND TN < StopTime AND TN > Ref(TN, -1);
Short = Ref(Close < LOWPRCCALC, -1) AND TN > StartTime AND TN < StopTime AND TN > Ref(TN, -1);

Sell = Ref(Close < LOWPRCCALC, 1) OR TN >= StopTime;
Cover = Ref(Close > HIGPRCCALC, -1) OR TN >= StopTime;

Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);

Short = ExRem(Short, Cover);
Cover = ExRem(Cover, Short);

BuyPrice = ValueWhen(Buy, Open);
ShortPrice = ValueWhen(Short, Open);

SellPrice = ValueWhen(Sell, Open);
CoverPrice = ValueWhen(Cover, Open);

LongTargetPrice = BuyPrice + (BuyPrice * Target);
ShortTargetPrice = ShortPrice - (ShortPrice * Target);

LongSLPrice = BuyPrice - (BuyPrice * Target);
ShortSLPrice = ShortPrice + (ShortPrice * Target);

Sell1 = High > LongTargetPrice;
Sell2 = Low < LongSLPrice;

Cover1 = Low < ShortTargetPrice;
Cover2 = High > ShortSLPrice;

Sell = Sell OR Sell1 OR Sell2;
Cover = Cover OR Cover1 OR Cover2;

SellPrice = IIf(Sell1, LongTargetPrice, IIf(Sell2, LongSLPrice, SellPrice));
CoverPrice = IIf(Cover1, ShortTargetPrice, IIf(Cover2, ShortSLPrice, CoverPrice));

Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);

Short = ExRem(Short, Cover);
Cover = ExRem(Cover, Short);

BuyPlotsCandles = (BarsSince(Buy)<BarsSince(Sell)) AND (BarsSince(Buy)!=0);
ShortPlotCandles = (BarsSince(Cover)>BarsSince(Short)) AND (BarsSince(Short)!=0);

Plot(IIf(BuyPlotsCandles, BuyPrice, Null), "Buy Price", colorYellow, styleStaircase|styleDashed);
Plot(IIf(BuyPlotsCandles, LongTargetPrice, Null), "Long Target", colorBrightGreen, styleStaircase|styleDashed);
Plot(IIf(BuyPlotsCandles, LongSLPrice, Null), "Long Target", colorCustom12, styleStaircase|styleDashed);

Plot(IIf(ShortPlotCandles, ShortPrice, Null), "Short Price", colorYellow, styleStaircase|styleDashed);
Plot(IIf(ShortPlotCandles, ShortTargetPrice, Null), "Short Target", colorBrightGreen, styleStaircase|styleDashed);
Plot(IIf(ShortPlotCandles, ShortSLPrice, Null), "Short Target", colorCustom12, styleStaircase|styleDashed);

Buyshape = Buy * shapeUpArrow;
SellShape = Sell * shapeStar;
PlotShapes( Buyshape, colorBrightGreen, 0, Low );
PlotShapes( SellShape, colorRed, 0, High );

Shortshape = Short * shapeDownArrow;
CoverShape = Cover * shapeStar;
PlotShapes( Shortshape, colorOrange, 0, High, -30);
PlotShapes( CoverShape, colorTurquoise, 0, Low, -30 );
 

OneThatGotAway

Well-Known Member
#6
ok first load a default afl .. click chart panes and load any afl ...
when it loads then u

Right click Edit formula and here once again click
File -->new and paste the new afl code it should work


OR alternatively
Click Analysis -->Formula editor
and paste new code and apply and make sure there is date in database lol
 

Similar threads