Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Export Amibroker Database All in One for Amibroker (AFL)

0 / 5 (Votes 0)
amibroker, database, export

Export database in csv or txt . Select parameter File Format .txt or .csv
Export data desired period. Select From Date and To Date in parameter.

Export data without timestamp stamp for EOD. Timeframe iEOD export with timestamp. EOD export without timestamp.

Define ouput file path in PC. Entrer drive in Output Drive. Enter folder name in Output Folder Name.

Export Name of Symbol without expiry date. Parameter Segment , Equity export the same name . Futures remove unwanted part and suffix -I or given value. Options remove expiry data or weekly and rename as Spot+Strike+CE/PE

Parameter Settings:

Future – No. of Characters after Name. To cut underlying Name. Eg. From BANKNIFTY-I.NFO to BANKNIFTY it need to cut 6 characters . So enter 6. To Cut BANKNIFTY22SEPFUT, it need to enter 8.

Future suffix. suffix to be added with above cut name. It cut name as above and suffix given value. BANKNIFTY-I.NFO to BANKNIFTY-I

Options – No. of Characters after Name. same as said for Futures.

Number of characters between Name and Strike. For BANKNIFTY_40000CE-15SEP2022 , there is underscore only between BANKNIFTY and 40000, So enter 1.

Length of Strike Price. For strike price 40000 have 5 digit. So enter 5.

Number of characters between Name and CE/PE. For BANKNIFTY_40000CE-15SEP2022, Between BANKNIFTY and CE , there is _40000, So enter 6

If you want export Aux1 and Aux2 also two lines disabled with // enable this and disable alternate line.

Select timeframe in Periodicity of Analysis Settings, like 1 Minutue, 5 Minute, Daily as required timeframe for export data. Click Explore to check settings are correct and click Scan to export


Indicator / Formula

Copy & Paste Friendly
Telegram @easysimpletrade

OPDIR = ParamStr("Output Drive", "C");
OPFOL = ParamStr("Output Folder Name", "OneMinuteData");

FFormat = ParamList("File Format", ".txt|.csv",0);

FDATE = ParamDate("From Date","01/01/22");
TDATE = ParamDate("To Date","31/12/22");

EODINT = ParamList("TimeFrame", "IEOD|EOD",0);

FNAMES = ParamList("Segment", "Equity|Futures|Options",0);

FUNAMEP = Param("Future - No. of Charcters after Name",2,0,50,1);
FUNAMESUF = ParamStr("Futuer Suffix", "-I");

OPNAMEP = Param("Options - No. of Charcters after Name",18,0,50,1);
OPSTKS = Param("No. of Charcters between Name and Strike",1,0,50,1);
OPSTKL = Param("Length of Strike Price",5);
OPCPS = Param("No. of Charcters between Name and CE/PE",6,0,50,1);

FUNAME = StrLeft(Name(), StrLen(Name()) - FUNAMEP)+FUNAMESUF;

OPSPOT = StrLeft(Name(), StrLen(Name()) - OPNAMEP);
OPCEPE = StrMid(Name(), StrLen(OPSPOT)+OPCPS,2);


FNAME = WriteIf(FNAMES == "Futures", FUNAME, WriteIf(FNAMES == "Options", OPNAME, Name()));

DNUM = DateNum();

if(Status( "action" ) == actionScan)

fmkdir( OPDIR+":\\"+ OPFOL);
fh = fopen( OPDIR+"://"+OPFOL+"//"+FNAME+FFormat, "w");

if( fh )
fputs( "Ticker,Date,Time,Open,High,Low,Close,Volume,OI\n", fh );
//fputs( "Ticker,Date,Time,Open,High,Low,Close,Volume,OI,Aux1,Aux2\n", fh );
YYY = Year();
MMM = Month();
DDD = Day();
HHH = Hour();
NNN = Minute();
SSS = Second();
for( i = 0; i < BarCount; i++ )
if(DNUM[i] > (FDATE-1) AND DNUM[i] <= TDATE)
fputs( FNAME + "," , fh );

ds = StrFormat("%02.0f-%02.0f-%02.0f,",YYY[ i ], MMM[ i ], DDD[ i ] );
fputs( ds, fh );
if(EODINT == "IEOD")
ts = StrFormat("%02.0f:%02.0f:%02.0f,",HHH[ i ],NNN[ i ],SSS[ 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 ] );
//qs = StrFormat("%.4f,%.4f,%.4f,%.4f,%.0f,%.0f,%.0f,%0.f\n",O[ i ],H[ i ],L[ i ],C[ i ],V[ i ],OI[ i ],Aux1[i],Aux2[i] );
fputs( qs, fh );
fclose( fh );

Filter = 1;
AddTextColumn(FNAME,"Output Symbol Name");
AddTextColumn(OPDIR+"://"+OPFOL+"//"+FNAME+FFormat,"Output File",1);


Leave Comment

Please login here to leave a comment.