- Joined
- 15 May 2016
- Posts
- 33
- Reactions
- 0
Plot( C, ""+Interval(2), styleCandle );
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
dt = DateTime();
SetBarsRequired( -2, -2 );
expandmode=expandPoint;
TimeframeSet( in1Minute ); // TimeframeSet(i * in1Minute);
up = C > O;
M1 = TimeFrameExpand( up, in1Minute , expandPoint );
TimeframeRestore();
TimeframeSet( 2*in1Minute );
up = C > O;
M2 = TimeFrameExpand( up, 2*in1Minute , expandPoint );
TimeframeRestore();
dist = 0.1*ATR(1);
for( b = 0; b < BarCount; b++ )
{
//------ yellow is the Invertedhammer with NO space
if( m1[b] ) PlotText( "1" , b, L[ b ]-1-dist[1], colorRed );
if( m2[b] ) PlotText( "2" , b, L[ b ]-1.4-dist[1], colorRed );
if( b > 11 )
[COLOR="#FF0000"]if (m2[b])
PlotText( "_m" , b, L[ b ]-1-dist[1], colorgold );
}[/COLOR]
Plot( C, ""+Interval(2), styleCandle );
for( i = 1; i < 3; i++ )
{
TimeframeSet( i*in1Minute );
up = C > O;
TimeframeRestore();
[B][COLOR="#FF0000"][SIZE=4]VarSet( "M" + i, TimeFrameExpand( up, i*in1Minute , expandPoint ) );
// Isn't M2 = TimeFrameExpand( up, 2*in1Minute , expandPoint ); ?[/SIZE][/COLOR][/B]
M = VarGet( "M" + i );
for( b = 0; b < BarCount; b++ )
{
if(M[b] ) PlotText(" "+(i), b, L[b]-1-(i), colorRed);
[COLOR="#FF0000"]if (M2[b])
{
PlotText( "" , b, y[ b ], colorRed );
}
[/COLOR]
}
}
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Hi. I have a question about using Amibroker intraday.
Could you tell me where you get ASX stocks real time data to Ami. and what the monthly fee is please?
Hi. I have a question about using Amibroker intraday. I am having problems aligning the different opening market phases with the price bars in Amibroker. Can someone please share their settings for intraday? Thanks
Hi all
Having a problem with some Ami code I cant seem to fix.
I am working on a simple system of buying the 250 day high and selling the 250 day low. My entry filters are Liquidity average being over 500,000 for the last 7 days and Turnover being higher than $500,000 for the last 7 days.
My problem is I would like to add the Turnover and Liquidity averages to the back test results. In the following cod I have managed to get the columns into the back test results but they have no data in them.
Any help would be much appreciated.
Thanks
SetTradeDelays( 1, 1, 0, 0 );
SetOption( "Initialequity", 100000 );
SetOption( "MaxOpenPositions", 20 );
SetPositionSize( 5, spsPercentOfEquity );
NewYearlyHigh = HHV( C, 250 );
Plot( NewYearlyHigh, "NewYearlyHigh", colorGreen, styleLine );
NewYearlyLow = LLV( C, 250 );
Plot( NewYearlyLow, "New Yearly Low", colorRed, styleLine );
Liquidity = EMA( V, 7 );
LiquidityOk = Liquidity >= 500000;
Turnover = EMA( C*V, 7 );
TurnoverOK = Turnover >= 500000;
SetCustomBacktestProc( "" );
if( Status( "action" ) == actionPortfolio )
{
bo = GetBacktesterObject();
bo.Backtest(); // run default backtest procedure
NumTrades = 0;
// iterate through closed trades first
for( trade = bo.GetFirstTrade(); trade; trade = bo.GetNextTrade() )
{
trade.AddCustomMetric( "Liquidity", Liquidity );
trade.AddCustomMetric( "Turnover", Turnover );
NumTrades++;
}
bo.AddCustomMetric( "Liquidity", Liquidity );
bo.ListTrades();
}
Buy = C >= NewYearlyHigh AND( MarketID( 0 ) == 0 OR MarketID( 0 ) == 1 ) AND LiquidityOk AND TurnoverOk;
Sell = C <= NewYearlyLow;
Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy );
P.S I am requiring the data for liquidity and turnover for two reasons. 1 I want to know the filter is working correctly and 2 I would like to know how to do it for future reference.
A heads up for anyone who may have used Quotetracker with Amibroker in the past. A plugin for Medved Trader is now available for 32-bit Amibroker.
Medved Trader:
https://www.medvedtrader.com/www/frontend
Broker/Data sources. (IB, Bell Direct, Commsec and ETrade in Australia)
https://www.medvedtrader.com/www/frontend/datasource
Amibroker Plugin:
http://www.amibroker.com/devlog/2016/09/13/medved-trader-data-plugin/
I don't use it personally so can't provide any assistance but there's been quite a few threads/questions regarding Quotetracker alternatives and ASX data plugins for Amibroker so thought I'd post this here for anyone who may have missed the announcement.
NOTE: To enable the API in Medved Trader, start the program, then go to:
FILE / SETTINGS / APPLICATION / API
and check the box to enable the API
Thanks. Now if we could just get the major Aussie brokers to cooperateThanks Jerry. Great to see your new application up and running. I used Quotetracker for a while early on. Not using Medved Trader myself but it's a great looking platform, well done
My ASX data seems to have been wiped after doing an 'indicator maintenance', but my last backup was almost a year ago.
When I go into C:\Program Files\AmiBroker\ASX\B\BHP
I can see the data for BHP is 155KB. Is this about the size of an EOD file for one stock going back 15 or so years? If it is, how do I go about getting the data showing again?
Thanks.
My BHP file is 58 kB for 6 years. Your data is not lost. Just to prove it you could copy the broker.master file from your old backup to the Data folder. Make sure you back up the current one somewhere.
Great thanks for that. What about getting the whole thing back working? Any ideas/?
The first thing to do is look at the Database path in Preferences|Data. I can't imagine why this would have changed while doing an indicator maintenance, though.
Are you getting a blank chart up with a message saying "not enough data?" Or is there no chart window?
TBH, I'm not such an expert and have encountered this kind of problem occasionally. Sometimes I just gave up and restored a backup.
This is classic troubleshooting and more details will be needed to solve it. Like what does it look like? What's missing, etc.
I'm happy to help to the best of my ability.
OK, my database looks about the same, those tickers should all display something. Do you have charts with those tickers?
If 99% display no charts, that would mean corrupted data.
Nope, no charts for those symbols shown. How could data get corrupted with an indicator maintenance?
Good question. Let me think about it. So you're saying that BHP shows no chart even though the file is 155 kB?
If so, can you attach or PM me the BHP file (or any of the others that don't display, doesn't matter).
My ASX data seems to have been wiped after doing an 'indicator maintenance', but my last backup was almost a year ago.
When I go into C:\Program Files\AmiBroker\ASX\B\BHP
I can see the data for BHP is 155KB. Is this about the size of an EOD file for one stock going back 15 or so years? If it is, how do I go about getting the data showing again?
Thanks.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?