Australian (ASX) Stock Market Forum

Amibroker FAQ

Hey guys,

I was playing around with the charts in amibroker and I accidentally closed my default chart. All of my trend lines, resistance/support lines etc. have been removed, how can I get them back?

Thanks.
 
Hi,

Does anybody here trade an intraday stock system automated system through I.B ?

Where did you get your historical data from (for system testing)?

Thanks.
 
Hey guys,

I was playing around with the charts in amibroker and I accidentally closed my default chart. All of my trend lines, resistance/support lines etc. have been removed, how can I get them back?

Thanks.

If you had saved the database then you could just reload the symbol on that database. Usually it will save it for you or you can ask it save changes. Check preferences under the Tools menu, go to Misc.

CanOz
 
Hello guys i am not so good in writing afl hence needed some expert or pro here to help me .

I trade on trade on 1 minute chart need an afl wich plots trailing sl line of 10 points , shud be green wen below stock and red above.

And if possible it shud prompt for no. points.
 
Counting Number of Trades per Year

Hello All,

I would like to add a "counter" to my AFL code which will be used to count all the trades taken PER YEAR. The Counter will increment by 1 each time a new Trade is taken. At the start of the next Year the Counter would reset to 0 and the process would start again.

I think I'm pretty comfortable with adding a new loop around my trade signals to capture this but the problem I have is to know when/how to reset the counter.

Can anyone help out?

Many Thanks in advance.....
 
Chorlton,

Are you talking about during a backtest? What do you then want to do with the count values, before you reset the counter each new year?

If you want it as a metric in the backtest results, you can do it in the high level custom backtester by iterating through all the trades at the end of the backtest.

GP
 
Chorlton,

Are you talking about during a backtest? What do you then want to do with the count values, before you reset the counter each new year?

If you want it as a metric in the backtest results, you can do it in the high level custom backtester by iterating through all the trades at the end of the backtest.

GP


Hi GP,

No I want to use the count in real-time. Basically I want to use the count value to determine how many trades have occured from the start of a new year. Using this information I can then make decisions about which future Signals I will actually take.

For example, if the count value is over x, use Buy Signals X, Y & Z otherwise use Buy Signals A, B, & C for the remaining year.


Hope this makes sense....
 
A few more questions then:

Where will the count be accessed - in indicator AFL, or in a scan or exploration?

How do you intend to persist the count value - in a file?

How will the AFL know when a trade has been taken? Is this some sort of automatic trading AFL, or will you have to do something to tell it there's been a new trade?

GP
 
A few more questions then:

Where will the count be accessed - in indicator AFL, or in a scan or exploration?

How do you intend to persist the count value - in a file?

How will the AFL know when a trade has been taken? Is this some sort of automatic trading AFL, or will you have to do something to tell it there's been a new trade?

GP

Hi GP,

Firstly, Thanks for your help on this.

My idea would be that the count would be assessed within the AFL code which defined the BUY & SELLSignals. Each time a BUY Signal appeared within a particular year the count would increment by 1. This process would continue for every BUY signal taken during that particular year. Once a BUY Signal appeared in the next year, the count would reset to 1 and the process repeated.

The AFL is just standard and would not be used for automatic trading.

What I want to achieve seems relatively straightforward in theory but judging by your questions I'm beginning to think that this could become quite complicated? If so, I may have to rethink what I want to achieve.....
 
I need afl for plotting trailing sl . Stop I place is in points(not %).
So need something like Param("Points",10,5,50,1).......default 10 pts, and in interval of 1 pt.

On crossing stock it turns color(red-green) and plot circle as i have given.

I think it will give errors if i run this on small scrips of 10-20 units but i only need it for Indian index Nifty(2950 units).
 
am learning AFL. Trying to write a bit of code as part of a buy condition that says, for example, AND if the close for the past 5 days is above the 50 day MA.

Basic idea is to make sure the close is above short term (say 5 day EMA) and above the mid term 50 day MA.

Should I use linearray? If someone knows how to write this particular bit that'll be a great help as i write simple code to learn how to put it all together. Your assistance will be greatly appreciated.
Thanks
 
Hey guys,

I recently got a trial version of Amibroker and am keend to test it out.

I have read about 12 pages of this thread and for the life of me cannot work out how to import data into the program.

I am aware there is free unclean data and paid clean data. For now I'm happy to try things out just with the former... but is there anyone out there who can tell me step by step how to do this?

Thanks.

(P.s. how live is the data?)
 
I recently got a trial version of Amibroker and am keend to test it out.

I am aware there is free unclean data and paid clean data. For now I'm happy to try things out just with the former... but is there anyone out there who can tell me step by step how to do this?

(P.s. how live is the data?)

For testing it (which I am doing) I am using EOD data. Setup a tickerlist and use Yahoo. Thsi is simplest for testing. With the trial you can't save it, so it seems.

Each ticker (share has to be teh 3 letter code plus .AX (e.g. BHP.AX, CBA.AX). Takes 10 mins to type up unless you want everything. I imported something somehow. USe the tutorials...
 
the count would be assessed within the AFL code which defined the BUY & SELLSignals

What AFL is that though? Are you talking about an indicator, where it runs every time the chart refreshes, or an exploration that you run manually?

Either way, the AFL could run many times on the same day, or it could go for days without being run (maybe if you're on holiday). To ensure you only count each buy signal once, and don't miss any, you'd need to track the date of the last buy signal you counted and next time start from that date, even if it's not the current date.

Also, the only way I know to persist information between invocations of AmiBroker is in files. You'd probably need to keep the count value and the last date in a file. There could be issues with this if the AFL is an indicator though, as when you scroll a chart the AFL is run many times, and having to read and possibly write a file every time could slow it down.

GP
 
Changing the colour of Zigzag lines

I am using the following code to plot points from the zig function that meet the
selection criteria.

Can anyone tell me how I can change the colour of the zigzag line between the
selected points to make that section more obvious?

Regards,

John




EnableScript("Jscript");
<%
function CreateDynVar( Varname, Varval )
{
AFL( Varname ) = Varval;
}
%>


scr=GetScriptObject();
X=BarIndex();
p=Param("p",5,5,30,1);
z=Zig(C,p);
//Plot(C,"C",1,64);
Plot(C,"C",colorBlack,styleBar);
CONDP=PeakBars(C,P)==0;SP=Cum(CONDP);

//Define EP1 to EP4 and TP1 to TP4
for(i = 1;i<=4;i=i+1)
{
scr.CreateDynVar("EP"+i,ValueWhen(CONDP,C,i));
scr.CreateDynVar("TP"+i,ValueWhen(CONDP,X,i));
}


CONDT=TroughBars(C,P)==0;ST=Cum(CONDT);
//Define ET1 to ET5 and TT1 to TT5
for(j=1;j<=5;j++)
{
scr.CreateDynVar("ET"+j,ValueWhen(CONDT,C,j));
scr.CreateDynVar("TT"+j,ValueWhen(CONDT,X,j));
}

// EW definition
EW8=EP3>EP4 AND EP2>EP3 AND EP2>EP1 AND ET4>ET5 AND ET3>ET2 AND
ET2>ET1 AND ET3>ET4 AND ET4>ET5 AND CONDT;
COLOR=colorIndigo;
PlotShapes(shapeDigit8*EW8,color);
G=Cum(CONDP OR CONDT);
GEW=SelectedValue(ValueWhen(EW8,G));


//Plot the EW counter
for(n=1;n<=9;n++)
{
PlotShapes((49-(2*n-(n%2)))*(G==GEW-n AND (n%2)*CONDP+(-1+n%2)*CONDT),Color);
}

Plot(EW8,"",colorGreen,2+styleOwnScale);
Plot(z,"",colorRed,styleThick);
Filter=EW8;// explore for all quotations
AddColumn(C,"C");
GraphXSpace=8;
 
Can anyone tell me how to get different time frames into Amibroker's tabbed sheets that retain their individual time frame?

I searched a bit back through this thread and found the pic below from one of Wayne's posts and it describes what I want to do.

However, I can rename the tabs, but as soon as I click on one of the time frame buttons (eg 1 minute), it turns ALL the sheets to 1 minute. Does it need a code for each time frame?

I've already wasted way too much time today trying to get this to work, so any help would be much appreciated!
 

Attachments

  • Amibroker time frames.png
    Amibroker time frames.png
    13.4 KB · Views: 124
Can anyone tell me how to get different time frames into Amibroker's tabbed sheets that retain their individual time frame?

I searched a bit back through this thread and found the pic below from one of Wayne's posts and it describes what I want to do.

However, I can rename the tabs, but as soon as I click on one of the time frame buttons (eg 1 minute), it turns ALL the sheets to 1 minute. Does it need a code for each time frame?

I've already wasted way too much time today trying to get this to work, so any help would be much appreciated!

I could be wrong Sails....i have been a few times before:eek:

But... I think the sheets at the bottom are linked directly to the same data time frame. The only way that i know that you can use different time frame is to use a new chart at the top of the page and then set your time frames....happy to be proven wronmg though.

Check the video tutorial under help.

Cheers,


CanOz
 
Can anyone tell me how to get different time frames into Amibroker's tabbed sheets that retain their individual time frame?

I searched a bit back through this thread and found the pic below from one of Wayne's posts and it describes what I want to do.

However, I can rename the tabs, but as soon as I click on one of the time frame buttons (eg 1 minute), it turns ALL the sheets to 1 minute. Does it need a code for each time frame?

I've already wasted way too much time today trying to get this to work, so any help would be much appreciated!

YES Sails, you can do it! Search for this "Working with chart sheets and window layouts" under help and it will tell you how to either link the sheets by symbol OR time interval.

Cheers,


CanOz
 
Thanks CanOz. I can't find that info on that page you suggested - perhaps it's because I only have AB version 4.8? Below is the text from the page of "Working with chart sheets and window layouts" minus the diagram. It mentions different display interval which I have put in bold below so I'm hoping it can still be done. Although, it doesn't mention how to either link the sheets by symbol OR time interval that you mentioned - unless I've missed it.

Seems to be more just setting up different layouts, and that's not what Wayne had on his snapshot.

Window layouts

A window layout is a complete set of multiple windows open each with different symbol, different display interval, different size, different set of chart sheets.

The picture below shows 4-window layout each with different set of indicator panes. To the left you can see "Layouts" pane in the Workspace window showing the list of stored local and global layouts.

Using AmiBroker 4.20 you can now have unlimited number of custom, multiple-window templates that can be switched between with just double click on layout name in the "Layouts" tab of the Workspace window.

You can open, save, delete layout by clicking on the Layout tree with right mouse button and choosing appropriate function. "Save As" option saves current layout under new name.

Local layouts are per-database while Global layouts are visible from all databases.

Information saved in layouts include: window sizes and postions, maximized/minimized state chart panes available on each sheet (independent for each window), selected bar interval, selected symbol, selected chart sheet

Most recently used layout can be saved on exit and database switch automatically (see: Tools->Preferences->Miscellaneous "Save on exit: Layouts")
 
Top