Simple Coding Help - No Promise.

I am trying to do an exploration to exclude stocks with missing bars. I can't find any setting to do so. Therefore, I am trying to code it into the AFL using a for loop and DaysSince1900() function. This is the first time I am using a for loop so I am not able to get the hang of it. Could someone help me here complete the code.

Code:
// Find stocks with missing dates

for(i = BarCount - 1; i >= BarCount - (21*6); i--)
{
// I am not sure what statement to write here. Any suggestions?
DaysSince1900() - Ref(DaysSince1900(), -1);
Daysdiff = (Ref(DaysSince1900(), -i)) - (Ref(DaysSince1900(), -i-1));
}

filter2 = (DaysSince1900() - Ref(DaysSince1900(), -1))<5; // This only excludes the particular date. I need to exclude the stock from the exploration.
filter = Close > 0;// AND filter2;
AddColumn( DaysSince1900(), "DaysSince1900");
AddColumn(DaysSince1900() - Ref(DaysSince1900(), -1), "Diff");
 
You don't need a loop for this. Try this:
Code:
filter4 = HHV(DaysSince1900() - Ref(DaysSince1900(), -1), 21*6) < 5; // Exclude those stocks where no data for 5 calendar days in the last 6 months.
 

Raj232

Well-Known Member
You don't need a loop for this. Try this:
Code:
filter4 = HHV(DaysSince1900() - Ref(DaysSince1900(), -1), 21*6) < 5; // Exclude those stocks where no data for 5 calendar days in the last 6 months.
Nice !! What would be the code to check for missing intraday candles ? e.g. in case we are at 2:15 PM .. and want to ensure that no missing 1 minute candles from 9:15 AM till 2:14 PM ..
 
This is code for TEMA of 9 period.

NTEMA= TEMA( C, 9 );

I want to plot it with color for following cond.

Cond1:IF NTEMA is rising,color white

Cond2:IF NTEMA is rising BUT slope of this line has decreased,Color Black.

Cond3:If NTEMA is falling Color black.

Cond4:If NTEMA is falling but Slope of this line has decreased,color white.
 

pannet1

Well-Known Member
View attachment 43146
If you asking something like this then yes it can be done.
beside if logic this clear then you can code anything in amibroker.
hi happylife,

sorry, missed your post, because, i did not get notified. thank you.

is there any public repository that has gazillion AFLs in one place.
 
Hi, I'm looking for aroon up down indicator afl. I found most of the online aroon afl having minor differences compared with metastock and some trading websites. Anyone can advise?

Sent from my SM-G935F using Tapatalk
 

Raj232

Well-Known Member
Hi, I'm looking for aroon up down indicator afl. I found most of the online aroon afl having minor differences compared with metastock and some trading websites. Anyone can advise?

Sent from my SM-G935F using Tapatalk
Check this and see if it works for you.. ::

_SECTION_BEGIN("Aroon");
EnableTextOutput(False);
BasePeriod = Param("Base Length", 14, 8, 50, 1);
SetChartOptions( 1, chartShowDates | chartWrapTitle, chartGrid20 | chartGrid30 | chartGrid50 | chartGrid70 | chartGrid80);
AroonDown = ((BasePeriod - LLVBars(L, BasePeriod)) / BasePeriod) * 100;
AroonUp = ((BasePeriod - HHVBars(H, BasePeriod)) / BasePeriod) * 100;
Plot(AroonUp, StrFormat(_SECTION_NAME()+" - Base: %g - UP", BasePeriod), colorGreen, styleLine);
Plot(AroonDown, " DOWN", colorRed, styleLine);
_SECTION_END();
 

Similar threads

Zerodha – Open Paperless Account

Open online account with Zerodha. Free delivery trading and Max Rs 20 for Intraday, F&O, Currency and Commodity Trading. Intraday High leverage with MIS, CO and BO.

Name:Phone:
Email:City:
State:
Are you a day trader?