AmiBroker formula Language

pkgmtnl

Well-Known Member
Sir can u please provide an AFL for ambroker for day trading that can give me a profit of 0.2% or more on each trade. i am a JOBBER( scalper) and work somewhere. if u can provide me with that i will be very gratefull else i lll loose my job please help me sir. The AFL shud give me buy and sell signals cause i dont have no knowledge of tech analysis. Please any help is appreciated.
thank you.
NO AFL is perfect,
Dnt commit blunder, u will loose all ur money.
Learn TA first,
 
Is this possible ?
What I am looking for is automation of the stock picking process. Please allow me to discuss in detail the aspects I am looking for.

1. Camarilla levels shall be calculated as per the following equations :
H5 = (H/L)*C
H4 = [1.1*(H-L)/2]+C
H3 = [1.1*(H-L)/4]+C
H2 = [1.1*(H-L)/6]+C
H1 = [1.1*(H-L)/12]+C

L1 = C-[1.1*(H-L)/12]
L2 = C-[1.1*(H-L)/6]
L3 = C-[1.1*(H-L)/4]
L4 = C-[1.1*(H-L)/2]
L5 = C-(H5-C)

2.These levels must be used to develop a Custom Indicator, a Custom Exploration and a Custom Expert Advisor.
3.All of the above must take care of trading holidays even those which fall within the week.
4.Custom Indicator : An integrated indicator which will display the weekly and daily Camarilla levels when plotted on any chart irrespective of whether it is an RealTime intraday chart, a daily chart or a weekly chart with easily recognisable colour coding. Also a seperate indicator for monthly Camarilla levels.
5.Custom Exploration : Three seperate explorations (daily, weekly and monthly) to find out which stocks are trading near any of the Camarila levels.
6.Custom Expert Advisor : An advisor which when attached to a chart, whether its an RT intraday chart, a weekly chart or a monthly chart, alerts with a visual and audio alert when the stock trades near any of the Daily, Weekly or Monthly Camarilla levels.
7.Changes necessary in the coding if the numbers (2,4,6,12) in the equations are to me modified.
8.System backtester.
9.Passowrd protection (of course should be know to me) for all of the above.

If anyone can provide me a code for the above or a part thereof, it will be of immense help.
Thank you.
i guess u can find this in linkons thread... his AFL for price have cams levels..

regards
 

sub2501

Active Member
hi,
i found this afl from amibroker's site to export & save intraday quotes in .txt from amibroker but there is a problem, it exports & saves quotes wrt time not wrt to date, i'm attaching both the quotes and afl, if any one can rectify pls
 
Last edited:

pkgmtnl

Well-Known Member
hi,
i found this afl from amibroker's site to export & save intraday quotes in .txt from amibroker but there is a problem, it exports & saves quotes wrt time not wrt to date, i'm attaching both the quotes and afl, if any one can rectify pls
try this
Use this AFL and Scan, it will save the TXT file in c:\savadata folder

but make sure u hav this data folder in C:\
if not make it


_SECTION_BEGIN("Export Intraday Data");

fh = fopen( "c:\\SaveData\\"+Name()+".txt", "w");
if( fh )
{
fputs( "Ticker,Date,Time,Open,High,Low,Close,Volume,openi ntrest \n", fh );
y = Year();
m = Month();
d = Day();
r = Hour();
e = Minute();
n = Second();

for( i = 0; i < BarCount; i++ )
{
fputs( Name() + "," , fh );
ds = StrFormat("%02.0f-%02.0f-%02.0f,",
y[ i ], m[ i ], d[ i ] );
fputs( ds, fh );

ts = StrFormat("%02.0f:%02.0f:%02.0f,",
r[ i ],e[ i ],n[ i ] );
fputs( ts, fh );

qs = StrFormat("%.4f,%.4f,%.4f,%.4f,%.0f,%.0f\n",
O[ i ],H[ i ],L[ i ],C[ i ],V[ i ],OI[ i ] );
fputs( qs, fh );
}

fclose( fh );
}

Buy = 0;
_SECTION_END();
 

lvgandhi

Well-Known Member
try this
Use this AFL and Scan, it will save the TXT file in c:\savadata folder

but make sure u hav this data folder in C:\
if not make it


_SECTION_BEGIN("Export Intraday Data");

fh = fopen( "c:\\SaveData\\"+Name()+".txt", "w");
if( fh )
{
fputs( "Ticker,Date,Time,Open,High,Low,Close,Volume,openi ntrest \n", fh );
y = Year();
m = Month();
d = Day();
r = Hour();
e = Minute();
n = Second();

for( i = 0; i < BarCount; i++ )
{
fputs( Name() + "," , fh );
ds = StrFormat("%02.0f-%02.0f-%02.0f,",
y[ i ], m[ i ], d[ i ] );
fputs( ds, fh );

ts = StrFormat("%02.0f:%02.0f:%02.0f,",
r[ i ],e[ i ],n[ i ] );
fputs( ts, fh );

qs = StrFormat("%.4f,%.4f,%.4f,%.4f,%.0f,%.0f\n",
O[ i ],H[ i ],L[ i ],C[ i ],V[ i ],OI[ i ] );
fputs( qs, fh );
}

fclose( fh );
}

Buy = 0;
_SECTION_END();
Thanks. But this afl gives only one data per day as shown below i the last few lines for Nifty_F1
NIFTY_F1,2010-02-23,00:00:00,4832.2998,4889.0000,4830.0000,4879.8999,22373648,0
NIFTY_F1,2010-02-24,00:00:00,4846.1001,4884.0000,4842.2998,4867.5000,23466538,0
NIFTY_F1,2010-02-25,00:00:00,4870.0000,4875.2500,4832.2002,4860.3999,22835350,0
NIFTY_F1,2010-02-26,00:00:00,4867.0000,5002.3999,4865.2002,4935.9502,43334416,0
 
Im the new member of this forum so hello everyone!

Few days ago i built a system but i need help to improve this one.

I don't know how to change formula that cond4 will not clashes with cond 5...
I want Trailing stop to start only if cond3 will take a place if not cond5 appears.
I've spent hours on this but i can't do that :|
Can sbd help me, please?

Cond3=StochK(14,5)>90;
Cond4=ApplyStop(2,2,40,2);
Cond5=StochD( 14, 4, 5 ) > StochK( 14, 5 );

Sell=0;

function _IIf( Cond3, Cond4, Cond5)
{
for( i = 0; i < BarCount; i++ );
{
if( Cond3[ i ] );
{
result[ i ] = Cond4[ i ];
}
if(Cond3=Null);
{
result=Cond5;
}
}
}
 
hi friends

i need some help with afl programming

ineed AB to draw a horizontal line at the crossover of tow indicators over a certain period.

thanks in advance
 

asnavale

Well-Known Member
Thanks. But this afl gives only one data per day as shown below i the last few lines for Nifty_F1
NIFTY_F1,2010-02-23,00:00:00,4832.2998,4889.0000,4830.0000,4879.8999,22373648,0
NIFTY_F1,2010-02-24,00:00:00,4846.1001,4884.0000,4842.2998,4867.5000,23466538,0
NIFTY_F1,2010-02-25,00:00:00,4870.0000,4875.2500,4832.2002,4860.3999,22835350,0
NIFTY_F1,2010-02-26,00:00:00,4867.0000,5002.3999,4865.2002,4935.9502,43334416,0
Hi Gandhi,

Please verify whether you are applying the AFL to EOD data.

-Anant
 

lvgandhi

Well-Known Member
Dear Anant,
I have applied for Intraday data which I got from Investbulls. I reverified today again. Case is same.
MINIFTY_F1,2010-06-02,00:00:00,4957.7002,5019.0000,4941.1001,5016.9502,1385400,0
MINIFTY_F1,2010-06-03,00:00:00,5060.0000,5107.3999,5049.0000,5098.0000,1207100,0
MINIFTY_F1,2010-06-04,00:00:00,5085.0000,5134.3999,5071.1499,5118.0000,891940,0
MINIFTY_F1,2010-06-07,00:00:00,5010.0000,5030.9502,4985.0000,5027.9502,1402080,0
MINIFTY_F1,2010-06-08,00:00:00,5031.8999,5054.0000,4938.2002,4964.0000,1589220,0
MINIFTY_F1,2010-06-09,00:00:00,4965.0000,5045.3501,4955.1499,5005.0000,1825860,0
MINIFTY_F1,2010-06-10,00:00:00,5010.0000,5093.0000,4996.2002,5090.0000,1519600,0
MINIFTY_F1,2010-06-11,00:00:00,5130.0000,5137.6499,5092.0000,5112.0000,1134300,0
MINIFTY_F1,2010-06-14,00:00:00,5127.9502,5209.7002,5127.9502,5206.0000,1203720,0
MINIFTY_F1,2010-06-15,00:00:00,5199.0000,5245.0000,5175.0000,5229.0000,1033480,0
MINIFTY_F1,2010-06-16,00:00:00,5253.0498,5253.0498,5210.3999,5223.2998,856000,0
MINIFTY_F1,2010-06-17,00:00:00,5217.0498,5296.0000,5205.1001,5286.0000,1037480,0
MINIFTY_F1,2010-06-18,00:00:00,5283.0000,5296.6001,5243.2002,5258.7500,854360,0
MINIFTY_F1,2010-06-21,00:00:00,5295.3501,5377.0000,5295.3501,5357.9502,769520,0
MINIFTY_F1,2010-06-22,00:00:00,5340.0000,5358.0000,5312.0498,5324.0000,682060,0
 

Similar threads