Simple Coding Help - No Promise.

hmp

Well-Known Member
Can we make afl for this pennant or flag breakout? also ema 5 should be crossed above 13,& 26.
Regards
In this Buy conditions for scanning/ exploration are as below
1)5 ema should remain above 13 & 26.Crossover may not necessarily happen on that day.
2) Last candle should be green & bullish engulfing with volume greater than previous.
3) Pennant or flag may be drawn manually after fulfilling above conditions.
Regards.
 
Last edited:
Please share the exact version number, machine config and number of tickers you are using. Also if you can share the article/the link about large data sets?

Intel i7, 12GB RAM. If one ticker is loaded in chart tab then it does not matter how many tickers are part of data base.

I'm talking about most recent AB versions. Just read release notes. All info is there.

If you haven't installed 64-bit then you also haven't used 64-bit OS as it seems. "No one" would install 32-bit software on 64-bit OS if there is 64-bit software available. IQFeed, Esignal,... provide tick data. Apart from that in realtime trading it does not make much sense to load months of tick data if trading on small time frame.
 

TradeOptions

Well-Known Member
Intel i7, 12GB RAM. If one ticker is loaded in chart tab then it does not matter how many tickers are part of data base.

I'm talking about most recent AB versions. Just read release notes. All info is there.

If you haven't installed 64-bit then you also haven't used 64-bit OS as it seems. "No one" would install 32-bit software on 64-bit OS if there is 64-bit software available. IQFeed, Esignal,... provide tick data. Apart from that in realtime trading it does not make much sense to load months of tick data if trading on small time frame.
watchinu, please tell if IQFeed has started providing the data for Indian Market ? Or you are referring to the US markets data only ?

Thanks and regards
 

sr114

Well-Known Member
Sir ji when time permits kindly post the AFL will work on week ends.:thanx:
Tinchu76

here is the afl

screen shots


Code:
//critical input from Trash [ASF]
dt = DateTime();
grid_day = (Day()!=Ref(Day(),-1)); 

DH = TimeFrameGetPrice( "H", inDaily, 0 );
DL = TimeFrameGetPrice( "L", inDaily, 0 );

Plot( DH, "\nDay Hi", colorGreen, ParamStyle( "Style", styleLine | styleThick  ) );
Plot( DL, "\nDay Lo", colorRed, ParamStyle( "Style", styleLine | styleThick  ) );
Plot(C,"",colorDefault,64);

 
DHcond = H == DH;
DLcond = L == DL; 

hi=HHV(V,grid_day);
lo=LLV(V,grid_day);
vol_col= IIf(dhcond, colorDarkGreen,IIf(dlcond,colorRed,colorBlack));

Filter = V > MA(V,15);//DHcond OR DLcond; // whatever cond u like u may put

SetOption( "Nodefaultcolumns", True );
AddTextColumn( Name(), "Symbol", 1 );
AddColumn( DateTime(), "Date/Time", formatDateTime );
AddTextColumn( Interval(2), "tf", 1 );
AddColumn( IIf( DHcond, ValueWhen( DHcond, dt ), Null ), "HHV DT", formatDateTime, colorWhite, colorDarkGreen, 120 );
AddColumn( H, "High", 1.2, IIf( DHcond, colorWhite, Null), IIf( DHcond, colorDarkGreen, colorWhite) );
AddColumn( IIf( DLcond, ValueWhen( DLcond, dt ), Null ), "LLV DT", formatDateTime, colorWhite, colorRed, 120 );
AddColumn( L, "Low", 1.2, IIf( DLcond, colorWhite, Null), IIf( DLcond, colorRed, colorWhite) );
AddColumn( C, "Close", 1.2 );
AddColumn( V,"Volume",1.0,colorWhite,vol_col);

//AddColumn(OI,"Open Interest",1.0); */

GraphXSpace=15;
 
Last edited:

Nehal_s143

Well-Known Member
After big rally or crash/fall most of the technical indicators becomes extreme bullish or extreme bearish, if V shape recovery comes after crash or inverted V shape fall comes after rally, we mostly fail to en-cash such moves.

I am trying to write afl for such V shape moves. Below afl is able to plot signal on such V shape moves, see today Nifty chart, plotted sell signal after rally, exactly before crash

This system will not work in range bound market, this is designed only for V shape moves

I want to add if condition to below afl to filter out rest of the signals

Plot sell only if there was up trend

(up trend = last 15 candles, at-list 5 candles have higher high then previous candle )

Plot buy only if there was down trend

(down trend = last 15 candles, at-list 5 candles have lower low then previous candle )

any other idea to define uptrend or down trend is also welcome

Please help to write if condition


Code:
// V Shape recovery or fall

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_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", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("Stochastic_5_MINS");
periods = Param( "Periods", 8, 1, 200, 1 );
Ksmooth = Param( "%K avg", 3, 1, 200, 1 );
Dsmooth = Param( "%D avg", 4, 1, 200, 1 );

k1 = StochK( periods , Ksmooth);
d1 = StochD( periods , Ksmooth, DSmooth );

_SECTION_END();

_SECTION_BEGIN("Stochastic_10_MINS");
periods = Param( "Periods", 8, 1, 200, 1 );
Ksmooth = Param( "%K avg", 3, 1, 200, 1 );
Dsmooth = Param( "%D avg", 4, 1, 200, 1 );

TimeFrameSet(in1Minute * 10);
k10 = StochK( periods , Ksmooth);
d10 = StochD( periods , Ksmooth, DSmooth );
TimeFrameRestore();

K2	=	TimeFrameExpand(k10, in1Minute * 10, expandFirst);
D2	=	TimeFrameExpand(d10, in1Minute * 10, expandFirst);


_SECTION_END();



ea = EMA (C,3);
eb = EMA (C,13);


Buy   = (C>O AND k1>d1 AND k2>d2 and ea>eb);
Sell  = k2<d2;
Short = (C<O AND k1<d1 AND k2<d2 and ea<eb);
Cover = k2>d2;

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

PlotShapes(Buy*shapeUpArrow,colorBlue,0,L,-21);
//PlotShapes(Sell*shapeHollowSmallDownTriangle,colorPink,0,L,-51);
PlotShapes(Short*shapeDownArrow,colorRed,0,H,-21);
//PlotShapes(Cover*shapeHollowSmallUpTriangle,colorSkyblue,0,H,-51);
 

Attachments

Bewinner

Well-Known Member
After big rally or crash/fall most of the technical indicators becomes extreme bullish or extreme bearish, if V shape recovery comes after crash or inverted V shape fall comes after rally, we mostly fail to en-cash such moves.

I am trying to write afl for such V shape moves. Below afl is able to plot signal on such V shape moves, see today Nifty chart, plotted sell signal after rally, exactly before crash

This system will not work in range bound market, this is designed only for V shape moves

I want to add if condition to below afl to filter out rest of the signals

Plot sell only if there was up trend

(up trend = last 15 candles, at-list 5 candles have higher high then previous candle )

Plot buy only if there was down trend

(down trend = last 15 candles, at-list 5 candles have lower low then previous candle )

any other idea to define uptrend or down trend is also welcome

Please help to write if condition
good concept.
 
This should work'

Code:
n= Param("No.of Bars",-1,-1,100,1);
m=Param("No of Earlier Bars",-1,-1,100,1);
Buy = (H > Ref(H,n)) AND (Ref(H,n) > Ref(H,m)) AND (L > Ref(L,n)) AND (Ref(L,n) > Ref(L,m)); 
Sell = (H < Ref(H,n)) AND (Ref(H,n) < Ref(H,m)) AND (L < Ref(L,n)) AND (Ref(L,n) < Ref(L,m)); 

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

PlotShapes(IIf(Buy, shapeUpArrow,shapeNone),colorGreen,0,L,-15); 
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,H,-15); 
Plot(C,"Close",colorDefault,64); 
Filter=Buy OR Sell ; 
AddColumn(C,"Close",1.2); 
AddColumn(Buy,"Buy Triggered",1); 
AddColumn(Sell,"Sell Triggered",1);


Hello amit ji,

When tried to scan the afl ,

it is not showing any scripts in scanner or explorer.... kindly check.

No buy sell signals on price too
 

Similar threads