Simple Coding Help - No Promise.

mrktmstr

Well-Known Member
Could anyone help me with this issue

I've a Excel based strategy generating Buy/Sell levels and respective Profit/Stoploss levels dynamically recieving Realtime data....

My Requirement is to get realtime data from Amibroker into excel and inturn pass the Signals from Excel to Amibroker on a realtime basis.

These signals should be Bactested in Amibroker on a Historical Data...

This thing will be of great help for those who are not proficient in AFL but hve some knowledge in Excel.....
 
Need to draw a 3 day/ 2 day chart. I mean 3day chart.. However in a week since there are 5 or 4 trading days, it needs to have a little bit of asymmetry into it.. Can someone help pls..

so alternate candle should have monday-wednesday, thursday-Friday OHLC..
Any code help pls?
 
Hi all,

Can some one help me with the following AFL wih the Buy and Sell conditions.

Buy on the bar after trigger bar i.e. buy if the Price is higher than trigger bar which is (C>MA(C,P1) AND C>MA(C,P2)) and sell if the price is lower than the trigger bar which is (C<MA(C,P1) AND C<MA(C,P2)).


SetChartBkColor(ParamColor("Outer panel color ",colorLightGrey));

SetChartOptions(0,chartShowArrows|chartShowDates);
SetPositionSize(2, spsShares);

_SECTION_BEGIN("Price");

_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
//Plot( C, "Close", ParamColor("Color", colorWhite ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();


_SECTION_BEGIN("MA");
P = ParamField("Price field",-1);
P1 = Param("Period1", 15, 2, 300, 1, 10 );
Plot( MA( C, P1 ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();

_SECTION_BEGIN("MA1");
P = ParamField("Price field",-1);
P2 = Param("Period2", 15, 2, 300, 1, 10 );
Plot( MA( C, P2 ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();

color = IIf(C>MA(C,P1) AND C>MA(C,P2),colorBlue,IIf(C<MA(C,P1) AND C<MA(C,P2),colorRed, colorBlack));
Plot( C, "Close", color, styleNoTitle |styleCandle );

Col=IIf(MA(C,P1)>MA(C,P2),colorLightBlue,colorYell ow);
PlotOHLC( 0,MA(C,P1), MA(C,P2), 0, "Cloud", col, styleCloud );

Buy = (C>MA(C,P1) AND C>MA(C,P2));
Short =(C<MA(C,P1) AND C<MA(C,P2));


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

PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorBlue, 0,L,Offset=-15);
PlotShapes(IIf(Sell, shapeStar, shapeNone),colorGold, 0, H, Offset=15);


Amruta
In the last four lines (colored in red), replace word Sell with word Short.
 
Hi friends,

I have one afl its good for delivery trading but some time these afl give false signal. please help me to remove these false signal. out of 10 only 1 signal is false remaning 9 is accurate so please modify and enjoy all for these good afl. Here i paste alf below.
9 out of 10 is a very good.
 

Blackhole

Well-Known Member
In the last four lines (colored in red), replace word Sell with word Short.

Buy = (C>MA(C,P1) AND C>MA(C,P2));
Short =(C<MA(C,P1) AND C<MA(C,P2));


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

PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorBlue, 0,L,Offset=-15);
PlotShapes(IIf(Sell, shapeStar, shapeNone),colorGold, 0, H, Offset=15);

or simply change/replace that red coloured short to sell :)
 
Can anyone please help me to code this in AFL

in Long Trade, BuyStop/Sell - 5 points less than the 34ema. This is not based on close of bar and trade should be stopped if the market touched this price.

in Short Trade, SellStop/Cover - 5 points greater than the 34ema. This is not based on close of bar and trade should be stopped if the market touched this price.
 

Similar threads