Australian (ASX) Stock Market Forum

Amibroker FAQ

Hi folks, I have another problem.

How can I get AB to tell me the point in time when an intraday high or a low was reached?

Thanks!
 
Hi folks, I have another problem.

How can I get AB to tell me the point in time when an intraday high or a low was reached?

Thanks!

Hi Joshsmi --

If you are using end-of-day data, you know four prices -- open, high, low, and close -- and two times -- open and close. You can make no assumptions about anything else.

If you are using intra-day data, you can look at the highest of the intra-day bars and note that time. But you will not know for certain whether it is the highest of the day until after the day is complete.

If you are looking for the highest price so far, look at the HHV statement.

Thanks,
Howard
 
Hi Joshsmi --

If you are using end-of-day data, you know four prices -- open, high, low, and close -- and two times -- open and close. You can make no assumptions about anything else.

If you are using intra-day data, you can look at the highest of the intra-day bars and note that time. But you will not know for certain whether it is the highest of the day until after the day is complete.

If you are looking for the highest price so far, look at the HHV statement.

Thanks,
Howard

Hi Howard, yes I was talking about intra-day not about EOD.

This is an example of a final solution for an intra-day time range. That means my problem got solved.

If you have a large intraday data base and you wanna use "all quotations" better use "hourly" in the settings of AA. In "Parameter" settings you can choose last (hourly) bar and pip value (e.g. EURUSD 0.0001 and USDJPY 0.01).

Code:
PipValue= Param("PIP Value",0.0001,0.0001,0.01,0.01);
LastBar=Param("Last Hourly Bar",230000,000000,230000,010000);
Filter = TimeNum() == LastBar;

isRtH1 =  TimeNum() >= 140000 AND TimeNum() < 180000;
RH1 = IIf(isRth1, H, Null);
RL1 = IIf(isRth1, L, 100000);
DayH1 = TimeFrameCompress( RH1, inDaily, compressHigh );
DayH1 = TimeFrameExpand( DayH1, inDaily, expandFirst );
DayL1 = TimeFrameCompress( RL1, inDaily, compressLow );
DayL1 = TimeFrameExpand( DayL1, inDaily, expandFirst );
aRH1= DayH1-DayL1;
RP1=round(aRH1/PipValue);

Days = Day();
LowestSoFar = LowestSince(Days != Ref(Days, -1), DayL1);
HighestSoFar = HighestSince(Days != Ref(Days, -1), DayH1);
TimeH = ValueWhen(H == HighestSoFar, DateTime());
TimeL = ValueWhen(L == LowestSoFar, DateTime());

AddColumn(RP1,"14-18 Range", 1.0, colorDefault, colorDefault,75);
AddColumn(DayH1,"14-18H",1.5,colorGreen,colorDefault,65);
AddColumn(DayL1,"14-18L",1.5,colorRed,colorDefault,65);
AddColumn(TimeH, "Time of High", formatDateTime,colorDefault, colorDefault,120);
AddColumn(TimeL, "Time of Low", formatDateTime,colorDefault, colorDefault,120);

Howard, do you know how to get rid of the date e.g. in the column Time of Low. I just wanna have an output of time without date. I assume it's not possible in Amibroker?

Cheers
 
Hi Joshsmi --

You asked: "Howard, do you know how to get rid of the date e.g. in the column Time of Low. I just wanna have an output of time without date. I assume it's not possible in Amibroker?"

Look at the builtin function DateTimeConvert and see if one of its options does what you want.

Or you can use NumToStr to do the conversion to a string variable, then manipulate the resulting string to select the time portion you want.

Thanks,
Howard
 
Folks I paid for some programming a few years back for a momentum swing based on numbers of bars and I am going to provide it here, as I am hoping someone with knowledge can help me modify it. Anyway the swing overlay instead of being direct zig zag lines actually has lines that move from high to high and then down to low to low etc which means that it is a lot more confusing on the chart. Can I get some help in modifying the swing line so that it is straite zig zags.

Further to that I want to place text above each swing that has the date, price, range in points and percentage and number of bars please ( I would modify the formulae I imagine to display only one or none etc of the the text outputs on the chart as the case may be. My primary text I need is the range in points and percentage.

. In the attached chart you will see that red and green overlay line is the current program line whereas I want it to do what the thick white line does.

Anyone who wants to use the formulae can use it with my blessing seeing I paid for it. Not that one can stop such use when it is publically paraded, but que sera

thanks

bars = Param("Swing Bars", 2, 1, 5, 1 );

SetBarsRequired(10000,10000);
_SECTION_BEGIN("Swing");
ShowShapes = ParamToggle("Show TurnPoints", "No|Yes",0);
ShowZig = ParamToggle("Show Swing Line", "No|Yes",1);

ArrayH = HHV(H,bars);
ArrayL = LLV(L,bars);


ValueL[bars] = ArrayL[bars];
ValueH[bars] = ArrayH[bars];
Value[bars] = ValueL[bars];

Bar = BarIndex();
BarTurn = 0;
BarEnd[bars] = bar[bars];
Moveup[bars] = 0;
Movedown[bars] = 1;
turnaround = turnprice[bars] = Null;
moveX = moveXup = moveXdown = 0;


for( i = bars+1; i < BarCount; i++ )
{
if( H>ValueH[i-1] AND Moveup[i-1] AND L<ArrayL[i-1] )// AND O>C ) // UU && Movedown[i-1]
{
Value = ArrayL;
ValueH = ArrayH;
ValueL = ArrayL;
BarEnd = Bar;
Moveup = 0;
Movedown = 1;
MoveXup = 0;
MoveXdown = 1;
MoveX = 1;
}
else
{
if( H>ArrayH[i-1] AND L<ValueL[i-1] && Movedown[i-1] )// AND O<C ) // UU && Movedown[i-1]
{
Value = ArrayH;
ValueH = ArrayH;
ValueL = ArrayL;
BarEnd = Bar;
Moveup = 1;
Movedown = 0;
MoveXup = 1;
MoveXdown = 0;
MoveX = 1;
}
else
{




if( H>ValueH[i-1] && Moveup[i-1] AND L>ValueL[i-1] ) // UU && H>H[i-1]
{
Value = ArrayH;
ValueH = ArrayH;
ValueL = ValueL[i-1];
BarEnd = Bar;
Moveup = 1;
Movedown = 0;
}
else
{
if( L<ArrayL[i-1] && Moveup[i-1] AND H<=ValueH[i-1] ) // UD && L<L[i-1]
{
Value = ArrayL;
ValueL = ArrayL;
ValueH = ValueH[i-1];
BarTurn = Bar;
BarEnd = Bar;
Moveup = 0;
Movedown = 1;
}
else
{
if( L<ValueL[i-1] && Movedown[i-1] AND H<=ValueH[i-1] ) // DD && L<L[i-1]
{
Value = ArrayL;
ValueH = ValueH[i-1];
ValueL = ArrayL;
BarEnd = Bar;
Moveup = 0;
Movedown = 1;
}
else
{
if( H>ArrayH[i-1] && Movedown[i-1] && L>=ValueL[i-1] ) // DU H>H[i-1] &&
{
Value = ArrayH;
ValueH = ArrayH;
ValueL = ValueL[i-1];
BarTurn = Bar;
BarEnd = Bar;
Moveup = 1;
Movedown = 0;
}
else
{
Moveup = Moveup[i-1];
Movedown = Movedown[i-1];
Value = Value[i-1];
BarEnd = BarEnd[i-1];
ValueH = ValueH[i-1];
ValueL = ValueL[i-1];
}
}
}
}

}}}

"Moveup "+Moveup;
"Movedown "+Movedown;
"moveX "+movex;
"MoveXup "+MoveXup;
"MoveXdown "+MoveXdown;

// OR Ref(moveXdown,-1) OR movexdown
// OR Ref(moveXup,1)
ValueXup = IIf( moveup OR Ref(moveXup,-1) OR movexdown OR movexup, Valueh, Null );
ValueXdown = IIf( movedown OR Ref(moveXdown,-1) OR movexup, ValueL, Null );
"Valueh "+Valueh;
ValueX = IIf( IsNull(ValueXdown), Nz(ValueXup), IIf( IsNull(ValueXup), Nz(ValueXdown) , Null));
//ValueX = Nz(ValueXdown)+Nz(ValueXup);

CreateTrough = ( moveUp AND Ref(moveDown,-1) ) OR moveXdown;
CreatePeak = ( movedown AND Ref(moveup,-1) ) OR moveXup;
LastOfRunUp = Ref(CreatePeak,1);
LastOfRunDown = Ref(CreateTrough,1);

turnref = barend==bar AND Ref(Barturn==Bar,1);
tptop = moveup AND BarIndex()==IIf( turnref, ValueWhen( LastOfRunUp, barend, 1 ), ValueWhen( LastOfRunUp, barend, 0 ) );
tpbot = movedown AND BarIndex()==IIf( turnref, ValueWhen( LastOfRunDown, barend, 1 ),ValueWhen( LastOfRunDown, barend, 0 ) );

pb = BarsSince(tptop);
tb = BarsSince(tpbot);

pp = ValueWhen( tptop, Value );
tp = ValueWhen( tpbot, Value );

Ctb = BarsSince( CreateTrough );
Cpb = BarsSince( CreatePeak );
CPp = ValueWhen( Createpeak, ArrayL );
CTp = ValueWhen( Createtrough, ArrayH );

RightTP = IIf( BarIndex()<ValueWhen( tpbot, BarIndex(), 0 ), ValueWhen( tpbot, ArrayL, 0 ), LastValue(Value) );
RightPP = IIf( BarIndex()<ValueWhen( tptop, BarIndex(), 0 ), ValueWhen( tptop, ArrayH, 0 ), LastValue(Value) );

RightTB = IIf( BarIndex()<ValueWhen( tpbot, BarIndex(), 0 ), ValueWhen( tpbot, BarIndex(), 0 ), BarCount-1 );
RightPB = IIf( BarIndex()<ValueWhen( tptop, BarIndex(), 0 ), ValueWhen( tptop, BarIndex(), 0 ), BarCount-1 );

x0 = IIf( tptop, ValueWhen( tptop, BarIndex(), 1 ), ValueWhen( tpbot, BarIndex(), 1 ) );
x1 = IIf( tptop, rightTB, RightPB );
y0 = IIf( tptop, pp, tp );
y1 = IIf( tptop, RightTP, RightPP );

/*
ZigColor = ParamColor( "Zig Colour:", colorYellow ) ;
if( ShowZig )
{

for( i=bars;i<BarCount;i++)
{
if( tptop OR tpbot )
{
Plot( LineArray( x0,y0,x1,y1,0,1), "", ZigColor, styleLine|styleNoRescale|styleThick|styleNoLabel );
}
}
}*/
//Plot( C, "", IIf(movedown,colorRed, IIf(moveup,colorGreen, colorLightGrey)), styleBar );
Plot( C, "", colorLightGrey, styleBar );



if( ShowShapes )
{
PlotShapes( shapeUpTriangle*TPbot, colorOrange, 0, arrayL, -8 );
PlotShapes( shapeDownTriangle*TPtop, colorBrightGreen, 0, arrayH, -8 );
PlotShapes( shapeStar*CreatePeak, colorBrightGreen, 0, Cpp , -16);
PlotShapes( shapeStar*CreateTrough, colorOrange, 0, Ctp, 16 );
}

_SECTION_END();

//PlotShapes( shapeCircle*(H>Ref(arrayh,-1)), colorBrightGreen, 0, H , 0);
//PlotShapes( shapeCircle*(L<Ref(arrayl,-1)), colorOrange, 0, L, 0 );
PlotShapes( shapeSquare*movex, IIf(movexdown,colorLightOrange,colorPaleGreen), 0, H/2+L/2, 0 );
//PlotShapes( shapeSmallCircle*IsTrue(Valuexup), colorBrightGreen, 0, Valuexup, 0);
//PlotShapes( shapeSmallCircle*IsTrue(Valuexdown), colorOrange, 0, Valuexdown, 0);

SetChartOptions( 0, chartShowDates );

if( ShowZig )
{

//Plot( Value, "", IIf(Ref(tb>pb,-1),colorRed, colorGreen), styleLine|styleThick );
Plot( Value, "", IIf(movedown,colorRed, colorGreen), styleLine|styleThick );

//Plot( ValueX, "ValueX", colorYellow, styleLine|styleThick );

//Plot( ValueXup, "ValueXup", colorGreen, styleLine|styleThick );
//Plot( ValueXdown, "ValueXdown", colorRed, styleLine|styleThick );

//Plot( ValueL, "", colorRed, styleDashed|styleThick );
//Plot( ValueH, "", colorGreen, styleDashed|styleThick );

}
GraphXSpace=10;

_N( Title = "{{NAME}} - {{INTERVAL}} {{DATE}} A134 {{OHLCX}} {{VALUES}}");
 
Greetings all --

The code provided by kotim compiles without error and executes.

The white line is not part of the code provided, but appears to connect points where there is either an arrow or a star.

Before spending much time with the system, use AmiBroker's "Bar Replay" feature and watch the creation and movement of the green and orange arrows and stars. Those that appear on the current bar sometimes move as additional data is received. Those that do not move do not always appear on the current bar, but sometimes appear for the first time on a past bar. Symbols sometimes appear on a bar, then disappear as additional data arrives.

Thanks,
Howard
 
Howard the stars are actually the point at which the swing reversal criteria is met to justify a new change in swing direction and the arrows are in fact the point whereby the most extreme point of the relevent bar of the swing reaches prior to its reversal.
 
is it possible in AFL to have your own array/arraylist that is independent of the length of the bar count. As I am having trouble finding array length function to loop this list.
The only code I have seen for use jscript or vbscript, is there something built into AFL that will handle this?
 
I’m currently running eSignal data into AB for the AUD. Previously I tried using the free IB data feed, but have had too many issues with backfilling, unreliable tick data etc. Broker is IB.
I’m curious to know if there are any issues related to using FXCM’s tick data into AB? How reliable is the data, are there backfill issues, and anything else I should be aware of.
In addition to this those of you who have used both IB and FXCM, appreciate any comparison comments.
 
I’m currently running eSignal data into AB for the AUD. Previously I tried using the free IB data feed, but have had too many issues with backfilling, unreliable tick data etc. Broker is IB.
I’m curious to know if there are any issues related to using FXCM’s tick data into AB? How reliable is the data, are there backfill issues, and anything else I should be aware of.
In addition to this those of you who have used both IB and FXCM, appreciate any comparison comments.

How do you import FXCM’s tick data into AB? Is there a plugin available?
I only know about the way of using MT4 as DDE source.
 
Hi Joshsmi --

If you are using end-of-day data, you know four prices -- open, high, low, and close -- and two times -- open and close. You can make no assumptions about anything else.

If you are using intra-day data, you can look at the highest of the intra-day bars and note that time. But you will not know for certain whether it is the highest of the day until after the day is complete.

If you are looking for the highest price so far, look at the HHV statement.

Thanks,
Howard

Thanks Howard! I've sent a PM to you.
 
I’m currently running eSignal data into AB for the AUD. Previously I tried using the free IB data feed, but have had too many issues with backfilling, unreliable tick data etc. Broker is IB.
I’m curious to know if there are any issues related to using FXCM’s tick data into AB? How reliable is the data, are there backfill issues, and anything else I should be aware of.
In addition to this those of you who have used both IB and FXCM, appreciate any comparison comments.

Ok, you were probably referring to this description www.amibroker.com/fxcm.html

There it is written that there is no automatic backfill because the AB DDE plugin doesn't provide auto backfill.

If you wanna have automatic backfill you have to use the MT4 plugin with rateserver.exe. You can find it at the Yahoo Amibroker group http://finance.groups.yahoo.com/group/amibroker/ in the files section
 
Ok, you were probably referring to this description www.amibroker.com/fxcm.html

There it is written that there is no automatic backfill because the AB DDE plugin doesn't provide auto backfill.

If you wanna have automatic backfill you have to use the MT4 plugin with rateserver.exe. You can find it at the Yahoo Amibroker group http://finance.groups.yahoo.com/group/amibroker/ in the files section

Yes that's the description I was referring to. Regarding the MT4 plugin, is it 'True' tick data? If so then that sounds like what I'm after. I'll check it out, thanks.
 
Yes that's the description I was referring to. Regarding the MT4 plugin, is it 'True' tick data? If so then that sounds like what I'm after. I'll check it out, thanks.

Well every new quote that gets updated in a MT4 M1 chart also gets updated in Amibroker.

You need to make a change in the settings of AB so that it gets updated immediately there. In the section intraday of the AB preferences change real-time refresh interval to 0 from 3.
 
I have a system that I’ve tested over approx 1 yr of eSignal tick data on the AUD.USD. This has been performed manually, which is very time consuming? I’m keen to have it tested in greater detail over a longer period of time. Therefore is anyone able to provide info of a reputable co. that can perform detailed backtesting in Amibroker. I have the code as an indicator which would give a coding expert a decent start to create what I’m after. My coding abilities are extremely average, if virtually non-existent. I’ve always struggled going beyond detailed excel formula!
Appreciate any suggestions.
 
I have a system that I’ve tested over approx 1 yr of eSignal tick data on the AUD.USD. This has been performed manually, which is very time consuming? I’m keen to have it tested in greater detail over a longer period of time. Therefore is anyone able to provide info of a reputable co. that can perform detailed backtesting in Amibroker. I have the code as an indicator which would give a coding expert a decent start to create what I’m after. My coding abilities are extremely average, if virtually non-existent. I’ve always struggled going beyond detailed excel formula!
Appreciate any suggestions.

AFAIK Howard Bandy can code up a system for you, although he may be busy finishing off his latest book atm, may be worth getting in touch with.

http://www.blueowlpress.com/

I do some coding but have no free time atm. I'm sure you don't want to share your whole system publicly but you may wish to post some of the basic structure here and people may be able to help you with converting it to AFL?

Otherwise the Amibroker Yahoo User's Group could probably point you to someone if you wished to post the question there. Sorry I can't be of more assistance. Best of luck with the project :)
 
Thanks for the Howard Bandy link. I'll start with an email to him and see if I get any where. If not I'll try the Yahoo Amibroker forum.
 
I have a system that I’ve tested over approx 1 yr of eSignal tick data on the AUD.USD. This has been performed manually, which is very time consuming? I’m keen to have it tested in greater detail over a longer period of time. Therefore is anyone able to provide info of a reputable co. that can perform detailed backtesting in Amibroker. I have the code as an indicator which would give a coding expert a decent start to create what I’m after. My coding abilities are extremely average, if virtually non-existent. I’ve always struggled going beyond detailed excel formula!
Appreciate any suggestions.

There are people on the AmiBroker Yahoo board who write code for clients:

http://finance.groups.yahoo.com/group/amibroker/

You might also find useful code in the Users Guide and library that might permit you to move from indicator to what you want:

http://www.amibroker.com/

(Whoops, did not see Captain Black's post, etc.)
 
Top