Australian (ASX) Stock Market Forum

Amibroker FAQ


Morning all

can someone please assist me with the following;

I would like to buy a stock tomorrow only if it trades higher than todays high.
this is my code so far. However it keeps buying at the open price.

Cond8 = buyprice >= Ref(high + (high * 0.005), -1);

thanks
 

Morning all

can someone please assist me with the following;

I would like to buy a stock tomorrow only if it trades higher than todays high.
this is my code so far. However it keeps buying at the open price.

Cond8 = buyprice >= Ref(high + (high * 0.005), -1);

thanks

Speak in terms of today, rather than tomorrow. It's easier.

SetTradeDelays(0,0,0,0);
BuyPrice = Ref(H,-1) + IIf(Ref(C,-1)<.1,.001,.005);
Buy = BuyPrice>L AND BuyPrice<=H;
 
thanks for your feedback Gringotts.

unfortunately my code is still not working.
it is still buying on the signal bar when i work like it to buy when the price
cross the previous days high.

maybe i should be looking at a Buystop.

https://www.amibroker.com/guide/h_backtest.html

So you can write the following to simulate real stop-orders:
BuyStop = ... the formula for buy stop level;
SellStop = ... the formula for sell stop level;

// if anytime during the day prices rise above buystop level (high>buystop)
// the buy order takes place (at buystop or low whichever is higher)
Buy = Cross( High, BuyStop );

what do you think?

thanks
 
thanks for your feedback Gringotts.

unfortunately my code is still not working.
it is still buying on the signal bar when i work like it to buy when the price
cross the previous days high.

"it is still buying on the signal bar when i work like it to buy when the price
cross the previous days high".

?

My code buys at the previous day's high + 1 price level intraday (today).
 
Just a thought:

....

kO6af2m.png


FOR 15 MINUTE , IT GIVES WRONG OUTPUT, USE BELOW CODE AND SEE BY YOURSELF

exploration should show candle time of 15min. bull candle
pHIrNLY.png
Code:
Plot( C, "Close", ParamColor( "Color", colorDefault ), styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() );
expandmode = expandfirst;
TF = in15Minute;
TimeFrameSet( TF );
dt = DateTime();
bull = C>O;
TimeFrameRestore();
fifteen = TimeFrameExpand( dt, TF, expandmode );
fifteenn = TimeFrameExpand( bull, TF, expandmode );
printf( "`15 Minute candle timeframe: " + DateTimeToStr( SelectedValue( fifteen ) ));
Filter = bull;
AddColumn( dt, "Date", formatDateTime );

All are Welcome

Solution: Use expand variable..
Somehow, it doesn't return correct values always ..
anyways ..
Code:
Plot( C, "Close", ParamColor( "Color", colorDefault ), styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() );
expandmode = expandfirst;
TF = in15Minute;
TimeFrameSet( TF );
dt = DateTime();
bull = C>O;
TimeFrameRestore();
fifteen = TimeFrameExpand( dt, TF, expandmode );
fifteenn = TimeFrameExpand( bull, TF, expandmode );
printf( "`15 Minute candle timeframe: " + DateTimeToStr( SelectedValue( fifteen ) ));
Filter = fifteenn;
AddColumn( fifteen, "Date", formatDateTime );

==========

Problem 1:
We wanna scan couple of last bars with exploration ..
So ..
Code:
Plot( C, "Close", ParamColor( "Color", colorDefault ), styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() );
expandmode = expandFirst;
TF = in15Minute;
TimeFrameSet( TF );
dt = DateTime();
bull = C>O;
TimeFrameRestore();

expanddt = TimeFrameExpand( dt, TF, expandmode );
expandbull = TimeFrameExpand( bull, TF, expandmode );
printf( "`15 Minute candle timeframe: " + DateTimeToStr( SelectedValue( expanddt ) ));
for( i = BarCount-1; i >= BarCount -8  ; i-- )
    {      newexpand =""; 
     newexpand +=  DateTimeToStr( expanddt[i] ); 
    }

Filter = 1;
//AddColumn( newexpand, "Date", formatDateTime ); //eXPANDED VARIABLE
//AddColumn( expandbull, "bull", 1, colorDefault, colorDefault, 70 ); (EXPANDED vARIABLE?)
AddColumn( Null, "DateTime", 1, colorDefault, colorDefault, 160 );

As you know, BarCount-1 equal to last bar ... and BarCount-8 equal to past 7 bars.
Let's see how we gonna make it ?

Whatever value is in Range box exploration , it always scan last 7 bars .. Yes, it means it's independant of Range .. KyZWVKT.png

Problem 2:

Use any exploration that've two columns with datetime..
or
You can use Solution exploration(above problem1), add one more column in it..

TncE0b2.png

Let's try it..
Exploration is useful only when you can do something with it on chart..
 
On a side note quoting the great Albert Einstein:

"Two things are infinite, the universe and human stupidity, and I am not yet completely sure about the universe."

Definitely a genius that guy was!
 
Hi, I'm using Premium Data and one watchlist "ASX - Franked Dividend Paying" I'd like to backtest stocks with a long history in this watchlist.

Is there a way to exclude stocks with say less than 10 years of data please?
 
Hi, I'm using Premium Data and one watchlist "ASX - Franked Dividend Paying" I'd like to backtest stocks with a long history in this watchlist.

Is there a way to exclude stocks with say less than 10 years of data please?

Run an exploration with date set at 10 years ago (day = Mon-Fri), then add the results to a watchlist.


Filter = IsTrue(Close) ;
Addcolumn(v*C,"IVT");
 
Afternoon

I like studying charts in Amibroker using the default charts within the Watch lists folder such as the 'S&P ASX 300 IndGrp Banks' etc etc.

I was wondering if there were watch lists of certain Industry Groups that go beyond the limited 200 or 300 charts, and cover the entire asx market of that particular group?

Let's say I like the Software & Services sector. I would like to see a watchlist of all the Asx companies in a list, not confined by 50, 200, 300 etc

Perhaps I couldn't find it..

It would be pretty hard to troll through the entire market and pluck tickers out individually

Hope that makes sense

Locky
 
Let's say I like the Software & Services sector. I would like to see a watchlist of all the Asx companies in a list, not confined by 50, 200, 300 etc
Locky
In the Symbols section find "Watch Lists" and then scroll down through the list until you come to the list of stocks you want. I.e. ---

Untitled.png
 
Hi All,

I'm currently using an hourly data base, for which I am compressing into 2 or 4 hour bars on the chart using TimeFrameCompress.

I am wondering if anyone know how to back test the strategy based on the compressed hourly bars (either 2 or 4) given option under Periodicity in the backtester settings.

Any help would be greatly appreciated,

Many thanks,

James
 
Hi All,

I'm currently using an hourly data base, for which I am compressing into 2 or 4 hour bars on the chart using TimeFrameCompress.
(You mean expanding into higher time frame)

1. If you set the Base Time Interval to 1 minute in Database Settings then you will save data from 1 minute upwards and not be restricted to 1 hour.
2. In Tools -> Preferences -> Intraday, Custom Time Intervals can be set.

This is my 1 minute database on top Periodicity and EOD database below Periodicity.

Untitled.pngUntitled1.png
 
(You mean expanding into higher time frame)

1. If you set the Base Time Interval to 1 minute in Database Settings then you will save data from 1 minute upwards and not be restricted to 1 hour.
2. In Tools -> Preferences -> Intraday, Custom Time Intervals can be set.

This is my 1 minute database on top Periodicity and EOD database below Periodicity.

View attachment 69093View attachment 69094


Thanks Wysiwyg,

That worked brilliantly! Appreciate the help.
 
Hi all

Amibroker usually does this backup thing with premium data every 30 days or so. It asks if i want to back up since it's being 30 days bla bla bla. In the past I have done this with not much thought and have lived happily ever after.

The last time i did this 30 days premium data backup thing with a few days ago and now my Amibroker has turned to ****

Everytime i open up Amibroker it opens up in some other weird database that can't even recognize popular tickers such as CBA or ANZ!

So I go upto File tab and scroll down to recent databases and click the appropriate - ASX Premium Data and it loads my database BUT THIS TIME...

1) Pretty much all my trendlines have disappeared (Hours upon hours of work)

2) My Simple Moving Averages have change to something else entirely (not a disaster since i can easily draw what i had in before in about 1 minute)

3) Under my custom watchlists i have created all the tickers are missing! (This takes time)

4) Whenever I reopen Amibroker it opens up as that F*&#$%*&$ weird non nonsensical database i mentioned above

It appears the problem started happening after i did that monthly Premium data backup thing where the only thing i do it hit that back up button in maintenance tab..

I am ongoing with support with both amibroker and norgate but atm it's not getting me anywhere. I would like to go back pre 30 day backup!

Thanks
Andrew
 
I have since corrected the faulty database to open with my original database BUT

MY TRENDLINES HAVE STILL DISAPPEARED ALONG WITH MA'S & TICKERS IN MY CUSTOM WATCH LISTS

Ffs the norgate support are useless and can't work out why either. I told them everything was fine and dandy until i did the monthy 30day backup procedure. I have done that in the past many times with no problems

Imagine that. A backup service that actually destroys days, upon days of charting

Now I have to redraw all my lines, ma's, watchlist tickers etc etc

I'm not sure I can be bothered. Has this happened to anyone?

Andrew
 
I have since corrected the faulty database to open with my original database BUT
MY TRENDLINES HAVE STILL DISAPPEARED ALONG WITH MA'S & TICKERS IN MY CUSTOM WATCH LISTS
Ffs the norgate support are useless and can't work out why either. I told them everything was fine and dandy until i did the monthy 30day backup procedure. I have done that in the past many times with no problems
Imagine that. A backup service that actually destroys days, upon days of charting
Now I have to redraw all my lines, ma's, watchlist tickers etc etc
I'm not sure I can be bothered. Has this happened to anyone?
Andrew

I'm sure the charts are there separate to those dwnloaded



I don't use ami but I think you have lost your smart charts ( thats what they call them in Metastock )
There are a few here who are Ami proficient
 
I'm sure the charts are there separate to those dwnloaded



I don't use ami but I think you have lost your smart charts ( thats what they call them in Metastock )
There are a few here who are Ami proficient

These charts don't seem very smart if they delete themselves after a premium data backup lol. Thanks for the response anyway. I am so bummed about this. I am praying there is a simple fix to this..
 
Top