i have access to a paper trading account from Interactive Brokers
if you want to do trading system development using amibroker
i suggest that we team up together and make a system for automatic trading
please email me at
[email protected] for any afl that you want to test in Amibroker in Real market data
i m trying to made a new afl... but i have some problem... pls help me .........
my email id :-
[email protected]
CY1 = Param("Short Cycle Length?" ,10, 1 ,1000 ,1 )/2;
CY2 = Param("Medium Cycle Length?" ,80, 1 ,1000 ,1 )/2;
M1 = Param("Short Cycle Multiplyer?" ,1, 0.01 ,10 ,1 );
M2 = Param("Medium Cycle Multiplyer?" ,3, 0.01 ,10 ,1 );
T1 = Ref(MA(Close ,CY1 ),CY1/2)+ M1*ATR(CY1 );
B1 = Ref(MA(Close ,CY1 ),CY1/2)- M1*ATR(CY1 );
T2 = Ref(MA(Close ,CY2 ),CY2/2)+ M2*ATR(CY2 );
B2 = Ref(MA( Close ,CY2 ),CY2/2)- M2*ATR(CY2 );
Plot(T1, "", colorLime);
Plot(B1, "", colorBlue);
Plot(T2, "", colorPink);
Plot(B2, "", colorRed);
GraphXSpace = 5;
_SECTION_BEGIN( "Price" );
SetChartOptions( 0, chartShowDates | chartShowArrows | chartLogarithmic | chartWrapTitle );
_N( Title = StrFormat( "{{NAME}} - " + SectorID( 1 ) + " - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " + WriteVal( V, 1.0 ) + " {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) );
Plot( C, "Close", colorRose, styleCandle | styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() );
if ( ParamToggle( "Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip = StrFormat( "Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: " + NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 ) ) );
}
_SECTION_END();
Buy = (L<=B1) ;
Sell = (H>=T1);
//ExRem(Buy,Sell);
//ExRem(Sell,Buy);
//PlotShapes(Buy*shapeUpArrow+Sell*shapeDownArrow,IIf(Buy,colorGreen,colorRed) );
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-10);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-20);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-15);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=20);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=30);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-25);
_SECTION_BEGIN("swing1");
messageboard = ParamToggle("Message Board","Show|Hide",0);
showsl = ParamToggle("Stop Loss Line", "Show|Hide", 0);
no=30;
res=HHV(L+ATR(30),no);
sup=LLV(H-ATR(30),no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
supres=IIf(avn==1,sup,res);
//s5d=IIf(avn==1,sup,res);
a=Cross(C,supres);
b=Cross(supres,C);
if (showsl == 0)
{
Plot(supres,"Stop Loss",colorCustom8,styleDots);
}
in this AFL my problem is that when it works on live market. the band expands and previous signal disappear... or new signal genearte on previous candle...
so how to solve the problem.....
problem may be solving by these things...
1) once value generated the value is recorded in any variable....
2) it changes only when the second signal generated....