Australian (ASX) Stock Market Forum

Amibroker FAQ

Hi Guys

Just got amibroker today and just playing around I deleted the price action from the chart.

How do I get it back?

TIA
 
Hi Guys

Just got amibroker today and just playing around I deleted the price action from the chart.

How do I get it back?

TIA

There are different possibilities. I guess you deleted it from Price (all in one).
Go to the Charts section in the sidebar and there go to folder Basic Charts. Choose price or price (all in one) and double-click it then close the pane where you deleted the price from. Another possibility is to create a new pane (click "+" at the left side of the tab) and drag&drop price on it. In the "+" menu there are also options "New Default Chart" or "New Blank chart". New blank chart is similar to new pane. Another one is right clicking on price AFL in "Charts" section and clicking insert, insert linked or overlay instead of double clicking. Read what each option means. If you overlay price on existing indicators that don't have price yet then you need to edit the code and cut the overlaid price code from the bottom and put it on top of the indicators code(s).

Here is a sum up in form of an animation
price.gif

BTW besides the help file there is a free book by Howard Bandy called Introduction to Ambroker second edition http://www.amibroker.com/devlog/2012/08/15/introduction-to-amibroker-2nd-edition-available/
 
ConstantVolumeBars (CVB):

When using CVB analysis, one can only back-test when using Tick as the base-interval. Given the limitation of 500K bars for the Tick-database, this only allows approx. one week (or less) of market action to be back-tested.

One can construct CVB charts using a 1-min. (or 15-sec.) as the base-interval, with no problems------but, no back-testing can be performed with this chart construction......only with Tick as the base-interval.

Before contacting AB Support, I thought I'd present my situation to this group. Any ideas?

Thank You!
 
ConstantVolumeBars (CVB):

When using CVB analysis, one can only back-test when using Tick as the base-interval. Given the limitation of 500K bars for the Tick-database, this only allows approx. one week (or less) of market action to be back-tested.

One can construct CVB charts using a 1-min. (or 15-sec.) as the base-interval, with no problems------but, no back-testing can be performed with this chart construction......only with Tick as the base-interval.

Before contacting AB Support, I thought I'd present my situation to this group. Any ideas?

Thank You!

There is no 500k bars limitation.
You can set your own max value in Windows registry.

500k default max value is set for a reason:
Hello,

500000 is "common sense" limit (put there to prevent users
from putting some extreme values without thinking), but
there is a registry setting that controls the limit and you can set
it to any value (as long as you have enough memory to hold that much data).
Contact support if you want to know what registry setting controls this.

Best regards,
Tomasz Janeczko
amibroker.com

Start the registry editor of Windows (start>run>regedit)
Add a new DWORD key in HKEY_CURRENT_USER\Software\TJP\Broker\Settings (right-click on 'Settings' and choose New>Dword)
and give the key the name MaximumNumberOfBars
After the new key is established double-click it and add your own decimal number of bars (in my example it's set to an extreme value of 10,000,000)

1yUayg.png
 
Trash,

Thank you very much for the help! I'd be using a local DB, and can see why TJ would keep that secret. I'd still like to use a DB with 15-sec. to 1-min. base interval----for ease of maintenance. The CVB charts are just fine (built from 1-min), but I guess the back tester would not be able to deal with that construction----time-stamp issue, I presume.
 
Trash,

Thank you very much for the help! I'd be using a local DB, and can see why TJ would keep that secret.

As mentioned the number of bars setting in data base settings refers to plugin-driven DB. So if you use local DB then it doesn't matter what # of bars setting is set there in DB settings.

I'd still like to use a DB with 15-sec. to 1-min. base interval----for ease of maintenance. The CVB charts are just fine (built from 1-min), but I guess the back tester would not be able to deal with that construction----time-stamp issue, I presume.

To me using CVB with 1-minute data doesn't make much sense as CVB as well as range bars are time independent. So it's best to rather use tick data then. But still if you wanna use 1-minute data and wanna activate the CVB option in backtester's periodicity settings then set to tick as Base time interval in DB settings.
 
Thanks Trash,

Works like a charm. I've just got to remember to change the settings back, after backtest (the 1min. is plug-in driven).

My reasoning for building CVB charts from 1-min. DB : I have ten years of 1-min. data-----only a few months worth of Tick data.
 
Thinking this will be an easy one for most - this relates to backtesting - how do I create an exit condition when the price after x days is less than the buy price?

Here is what I have been trying, e.g. check after 3 days-

EntryPrice = BuyPrice[1];
ExitPrice = BuyPirce[3];

if (ExitPrice < EntryPrice )
ExitEarly = True;
else
ExitEarly = False;


Sell = Other Conditions or ExitEarly ;
 
Thinking this will be an easy one for most - this relates to backtesting - how do I create an exit condition when the price after x days is less than the buy price?

Here is what I have been trying, e.g. check after 3 days-

EntryPrice = BuyPrice[1];
ExitPrice = BuyPirce[3];

if (ExitPrice < EntryPrice )
ExitEarly = True;
else
ExitEarly = False;


Sell = Other Conditions or ExitEarly ;

SetTradeDelays( buydelay, selldelay, shortdelay, coverdelay )

I think this might work.
 
Thanks Gringotts,

I am thinking the set trade delays will apply to all trades - my early exit is conditional i.e. only exit if the price on day x is less than the buy price...

Cheers
 
I think I have worked it out, however maybe not the most elegant solution -

EntryPrice = ValueWhen(True, C, 1);
ExitPrice = ValueWhen(True, C, x );

EarlyExit = ExitPrice < EntryPrice ;

where x is the number of days to check the price for
 
Hi all,

Still struggling with this one.... any suggestions welcome :banghead:

This is for backtesting...

In words - check the price after x days, if less than the buy price, exit.

my latest attempt is -

NumBars = BarsSince(Buy);

StartingPrice = ValueWhen(NumBars = 1, C, NumBars );
CheckPrice = ValueWhen(NumBars > x, C, NumBars );
EarlyExit = CheckPrice < StartingPrice;

Sell= EarlyExit ;
 
I think I have worked it out, however maybe not the most elegant solution -

EntryPrice = ValueWhen(True, C, 1);
ExitPrice = ValueWhen(True, C, x );

EarlyExit = ExitPrice < EntryPrice ;

where x is the number of days to check the price for

True = ???????;
EntryPrice = ValueWhen(True, C, 1);

When you define what "true" equals then perhaps you can come up with an EntryPrice that doesn't keep changing!
 
True = ???????;
EntryPrice = ValueWhen(True, C, 1);

When you define what "true" equals then perhaps you can come up with an EntryPrice that doesn't keep changing!

Hi rnr,

Does my more recent post make more sense? Still very new to AB and I am not sure which array I should be accessing to check the prices - I have used C, but thinking maybe I should be using the Buy array. Any guidance is appreciated :)
 
I'm looking for a code which does the following-

when the current price is higher than 60day MA there is a green ribbon at the bottom of that chart and a red ribbon visa versa.

Can anyone point me in the right direction?
 
I'm looking for a code which does the following-

when the current price is higher than 60day MA there is a green ribbon at the bottom of that chart and a red ribbon visa versa.

Can anyone point me in the right direction?

Double click it to get it to an own pane.

Code:
// Main coding by Johsun on Amibroker@YahooGroups.com 29th July 2006

SetBarsRequired( 10000, 0 ); // This line required to avoid the Ribbon Text disappearing off screen (to Barcount(1) [GBS]
SetChartOptions( 3, chartGridMiddle );
Title = "Price above/below MA?"; // This line eliminates the default Title text at the top right of the Pane if set as "" [GBS]
GraphXSpace = Param( "Set Ribbon(s) Depth (if in extra pane)", 10, 0, 50, 1 ); // Makes space at top of Pane for a Title GBS

procedure ribbon( ribbon_nr, Caption, Color )
{
    firstbar = Status( "firstvisiblebarindex" );
    lastbar = Status( "lastvisiblebarindex" );

    xOffset = ( lastbar - firstbar ) / 100;
    yOffset = Param( "Y-Offset 4 Ribbon Text", 0.65, 0.1, 1, 0.01 );

    y2 = ribbon_nr;
    y1 = y2 - 1;

    Plot( y2, "", colorBlack, styleLine | styleNoLabel );
    Plot( 0, "", colorBlack, styleNoDraw );
    Plot( y2, "", Color, styleArea | styleNoLabel );
    PlotText( Caption, firstbar + xOffset, y2 - yOffset, colorWhite );
}

pds = Param( "MA Period", 60, 1, 500, 1 );
MA_ = MA( C, pds );
dsscol = IIf ( MA_ > C, colorRed, colorBrightGreen );
ribbon( 1, "MA-" + pds, dsscol );

// add additional ribbons below using procedure ribbon( ..., ..., ...);


BgColor = ParamColor( "BgColor", colorBlack );
SetChartBkColor( ParamColor("Color Axes", colorBlack) ); 
SetChartBkGradientFill( ParamColor("Background Top", BgColor ), ParamColor("Background Bottom", ColorRGB(100, 100, 100)) , ParamColor("Background Title", BgColor) );
 
Top