AmiBroker Tips

#11
need help regarding AmiBroker

hi...im using fibotrader. its extremely good. all credit goes to Soumya.
now i've installed amibroker. i dont know how to use it for NSE BSE. i would like to chk it. plz help me. i wanna know the etire process.
thanks.
 

asnavale

Well-Known Member
#12
Re: need help regarding AmiBroker

hi...im using fibotrader. its extremely good. all credit goes to Soumya.
now i've installed amibroker. i dont know how to use it for NSE BSE. i would like to chk it. plz help me. i wanna know the etire process.
thanks.
I assume you wanto use it for daily data(not intraday). First you have to create a database for the stocks of BSE and NSE. Then import historical EOD data into the database. You can get historical data from yahoo group 'bse-nse2005'. Recent data is available in that group's files section. Older data can be downloaded from the links given in the messages posted in that group. You can get instructions on how to import the data into AmiBroker in the files section of that group. If you need more information please post your reply here in this forum. I will try to help you.

Regards

-Anant
 

asnavale

Well-Known Member
#14
Dear Senior and knowldgeable members,

I want some help with Explorations and Charting in AmiBroker. I want to do two things:

1) I want to plot selected security data (EOD) for a particular period, for example, let us say April 10, 2004 to January 25, 2005 (If starting date is a holiday then the next trading day and if ending date is a holiday then previous trading day). The indicators I apply should be calculated using only the plotted data not the entire available data. In Ami the indicators are calculated from the very first available data upto the last one even though the visible chart portion is much smaller. In effect what I want is the graph should be drawn as if the security data is available only for the selected date range. Even if I try to move the chart pane beyond the selected date range (with arrow keys) the chart should not move past the selected dates on either side.

2. The second objective is similar to the above but instead of chart I want exploration. I should be able to do exploration with the data within the selected date range. For example, as in the above date range, if I want to calculate cumulative volume (using Cum function), the calculation should start with the volume data of the start date selected and stop with the end date. In exploration page in Ami there is an option to select the range of date for exploration. But this does not do what I want. It simply shows the results in the selected date range. Thus, if I want cumulative volume between selected date range, what it actually does is calculate the cum vol right from the very first data available but shows the results for the selected date range.

Can these be implemented by writing an AFL? If I have not been clear in expressing what is my aim please ask. I will clarify further.

Thank in advance.

-Anant
 
#15
Hello Seniors,

Can anyone give a simple code in Amibroker for alert of any cross e.g. if I want alert at crossover of EMA(15) & EMA(30) how can I get this.

Can I get Alert if price goes above/below any predefined value.

Can I get alert if RSI is above/below a predefined value for sometime ( say 10 min).

Regards,

K S Kachhwaha
 
#16
Hi Satya,

How to export intraday data in .csv format?

Best Regards,
Soumya
/*
Export intraday and EOD data to .csv files. One file for each stock.In the first line insert the directory you want to save them to, make sure the directory exists.Select your charts to export with the "Apply to" filter in AA window. Select the timeframe period you want to save as using the AA "Settings"
Press Scan button
*/

fh = fopen( "c:\\SaveData\\"+Name()+".csv", "w");
if( fh )
{
fputs( "Ticker,Date,Time,Open,High,Low,Close,Volume \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\n",
O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] );
fputs( qs, fh );
}

fclose( fh );
}

Buy = 0;
 
#17
Hello Seniors,

Can anyone give a simple code in Amibroker for alert of any cross e.g. if I want alert at crossover of EMA(15) & EMA(30) how can I get this.

Can I get Alert if price goes above/below any predefined value.

Can I get alert if RSI is above/below a predefined value for sometime ( say 10 min).

Regards,

K S Kachhwaha
I give below details of an afl file which gives alerts for macd crossovers

a=EMA(C,30)-EMA(C,200);
b=EMA(a,20);


Buy = Cross( a,b );
Sell = Cross( b,a );
//Short = Sell;
//Cover = Buy;

AlertIf( Buy, "", "MACD BUY", 1,1+2 );

AlertIf( Sell, "", "MACD SELL", 2 ,1+2);

You may define/modify a and b in above formulae as per your requirements and get alerts.
regards.
 
Last edited:
#18
I give below details of an afl file which gives alerts for macd crossovers

a=EMA(C,30)-EMA(C,200);
b=EMA(a,20);


Buy = Cross( a,b );
Sell = Cross( b,a );
//Short = Sell;
//Cover = Buy;

AlertIf( Buy, "", "MACD BUY", 1,1+2 );

AlertIf( Sell, "", "MACD SELL", 2 ,1+2);

You may define/modify a and b in above formulae as per your requirements and get alerts.
regards.
Thanks a lot sir. I tried with 'Buy/sell' but do not put 'Alertif' in formula.....:) ....thanks again.
 

beginner_av

Well-Known Member
#19
Dear asnavale,

For explorations it is very easy to use...just define the date range with the from and to on top left of the automatic analysis window and u get it or if u know the no of days...pls click on the button n = and put the number of days.
 

beginner_av

Well-Known Member
#20
for ur other query try this. DISCLAIMER: I havent tried it myself. before plotting ur indicator use nlastbar = the number of days for which u want the bars to be included.
 

Similar threads