Australian (ASX) Stock Market Forum

Amibroker FAQ

Amibroker not working after Windows 10 auto upgrade.

All my Amibroker setup gone missing or reference link missing.

Anyone having this problem?
 
Amibroker not working after Windows 10 auto upgrade.

All my Amibroker setup gone missing or reference link missing.

Anyone having this problem?

Win 10 Anniversary edition update installed on weekend successfully with no issues here....
 
Would anyone like to have a go at converting this pseudocode into AFL? It was developed by StrategyQuant software which I'm trialing. Some of it is very basic, other parts I have no idea what it means.

--------------------------------------------------------------------
Pseudo Source Code of Strategy 1.41
with parameter names.

Generated by StrategyQuant version 3.8.1
Generated at Tue Oct 04 22:48:00 GMT 2016

Tested on DAX, M5, 13.01.2006 - 25.02.2008
Spread: 0.5, Slippage: 0.0, Min distance of stop from price: 0.0
--------------------------------------------------------------------
====================================================================
== Entry conditions
====================================================================
LongEntryCondition = ((Day of week <> Wednesday) And ((Minute < 11) And (ATR(66) < ATR(69))))
ShortEntryCondition = ((Day of week <> Wednesday) And ((Minute < 11) And (ATR(66) > ATR(69))))


====================================================================
== Entry orders
====================================================================
-- Long entry
if LongEntryCondition is true {
if No position is open then Buy at Open(15) + (0.6 * BarRange(99)) Stop;
Stop/Limit order expires after 23 bars.

Profit Target = (0.93 * ATR(97)) pips;
}

-- Short entry
if ShortEntryCondition is true {
if No position is open then Sell at Open(15) + (-0.6 * BarRange(99)) Stop;
Stop/Limit order expires after 23 bars.

Profit Target = (0.93 * ATR(97)) pips;
}
 
Would anyone like to have a go at converting this pseudocode into AFL? It was developed by StrategyQuant software which I'm trialing. Some of it is very basic, other parts I have no idea what it means.

--------------------------------------------------------------------
Pseudo Source Code of Strategy 1.41
with parameter names.

Generated by StrategyQuant version 3.8.1
Generated at Tue Oct 04 22:48:00 GMT 2016

Tested on DAX, M5, 13.01.2006 - 25.02.2008
Spread: 0.5, Slippage: 0.0, Min distance of stop from price: 0.0
--------------------------------------------------------------------
====================================================================
== Entry conditions
====================================================================
LongEntryCondition = ((Day of week <> Wednesday) And ((Minute < 11) And (ATR(66) < ATR(69))))
ShortEntryCondition = ((Day of week <> Wednesday) And ((Minute < 11) And (ATR(66) > ATR(69))))


====================================================================
== Entry orders
====================================================================
-- Long entry
if LongEntryCondition is true {
if No position is open then Buy at Open(15) + (0.6 * BarRange(99)) Stop;
Stop/Limit order expires after 23 bars.

Profit Target = (0.93 * ATR(97)) pips;
}

-- Short entry
if ShortEntryCondition is true {
if No position is open then Sell at Open(15) + (-0.6 * BarRange(99)) Stop;
Stop/Limit order expires after 23 bars.

Profit Target = (0.93 * ATR(97)) pips;
}

It's almost easy language is it?

Looks like a nice snug curve for too...
 
If anyone wondering like me,for those I post few lines of code here with little progress.

As you might know, afl is similar to C .. that's what I've been told ..

Below C code count number of digits.
like count size of array. 2 to <10 . .array size: 8
I've no idea , how to do it in amibroker, even though similar to C

Working C code that count number of digits

Code:
#include <stdio.h>
    int main(){
    long n;
    int count = 0;
    int m[10],i;

    for( i = 2; i < 10 ; i++ )
    {
        n /= 10;
        ++count;
        m[i]=i+1;
        printf("m[%d]= %d\n",i+1,m[i]);

    }

    printf("Counting number of digits: %d", count);
    }

Output(click on link):
https://ideone.com/fP2boO


Below code need to get correct:


Code:
SetBarsRequired(-2,-2);
Plot( C, ""+Interval(2), styleCandle );
for( i = 1; i <4 ; i++ )
{
   TimeFrameSet(i*in1Minute );
   rs = RSI(14);
   TimeFrameRestore();
   VarSet( "M"+ i, TimeFrameExpand( rs, i*in1Minute , expandPoint ) );
M = VarGet( "M" + i );

   for( b = 0; b < BarCount; b++ )
    {
if(M[b] )   PlotText(" "+(i), b, L[b]-1-(i), colorAqua);
}
}
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );SetBarsRequired(-2,-2);


/*
shape2 = 0;
shape3 = 0;
for( b = 0; b < BarCount; b++) {[COLOR="#0000CD"]// visible chart area loop // y[I]ou can also use  bi = Barindex();
 //   fvb = FirstVisiblevalue( bi );
 //   lvb = LastVisiblevalue( bi );[/I][/COLOR]
  
getvar = ....;
    switch( getvar  ) {
        case 2: ....
  
        case 3: ....

            default: break;
    }                  
}      

PlotShapes( shape2 * shapeSmallCircle, colorWhite, 0, L, n*-35 );
PlotShapes( shape3 * shapeSmallCircle, colorYellow, 0, L, n*-35 );

ic80Z2z.png
In above picture,i haven't written all 2x and 3x .. yes we have to make it like above picture.. yes it's manually drawn,not real.



We've working C code, this language is similar to C ..
We're missing something...
 
Hey

Is there a reason why I sometimes see these charts in Amibroker that look wrong..

What I see is just flat lines with dots on the bottom of my chart

I also have no idea how to expand this section when I zoom in so i can barely see the tops and bottoms of candles..?

Here's a pic

CheersScreen Shot 2016-10-27 at 4.17.40 pm.png
 
Been using Ami. 7 years and never had that issue. Is that code ProShares UltraShort MSCI Mexico Cpd IMI (SMK)?
 
Also... Is there a way to use the Sectors as RS indicators?

That would be perfect but thus far the best I can do is use Industry or IndGrp as RS indicators because they have tickers I can easily type in the parameters section

Do sectors have tickers?

Cheers
 
Also... Is there a way to use the Sectors as RS indicators?

That would be perfect but thus far the best I can do is use Industry or IndGrp as RS indicators because they have tickers I can easily type in the parameters section

Do sectors have tickers?

Cheers

Once you get your Norgate data feed sorted lockscombi you could put something like this onto an Amibroker pane to plot relative strength (performance) of sectors. Norgate will give you plenty of index and industry tickers to play with.

Code:
_SECTION_BEGIN("Sector strength");
// Look for relative strength of sectors wrt their S&P
// Plot the 13 week EMA of incremental differences
// This is useful for finding strengthening sectors / industries
// Normalize data
//  Based on:  http://www.amibroker.com/library/detail.php?id=184

Sum_Filter = 9;
Index_Value = Foreign("XAO","close");

Energy_Ratio      = Foreign("XEJ","Close",fixup=1) / Index_Value;
Materials_Ratio   = Foreign("XMJ","Close",fixup=1) / Index_Value;
Consumer_Discret_Ratio = Foreign("XDJ","Close",fixup=1) / Index_Value;
Health_Ratio     = Foreign("XHJ","Close",fixup=1) / Index_Value;
Tech_Ratio        = Foreign("XIJ","Close",fixup=1) / Index_Value;
Finance_Ratio     = Foreign("XFJ","Close",fixup=1) / Index_Value;


Energy_Perf       = EMA(Energy_Ratio      - Ref(Energy_Ratio,-1),13) * 10000;
Materials_Perf    = EMA(Materials_Ratio   - Ref(Materials_Ratio,-1),13) * 10000;
Consumer_Discret_Perf  = EMA(Consumer_Discret_Ratio - Ref(Consumer_Discret_Ratio,-1),13) * 10000;
Health_Perf =  EMA(Health_Ratio - Ref(Health_Ratio,-1),13) * 10000;
Tech_Perf         = EMA(Tech_Ratio        - Ref(Tech_Ratio,-1),13) * 10000;
Finance_Perf      = EMA(Finance_Ratio     - Ref(Finance_Ratio,-1),13) * 10000;


N_Energy_Perf    = (Energy_Perf)    / Foreign("XEJ","Close",fixup=1);
N_Materials_Perf = (Materials_Perf) / Foreign("XMJ","Close",fixup=1);
N_Consumer_Discret_Perf = (Consumer_Discret_Perf) / Foreign("XDJ","Close",fixup=1);
N_Health_Perf = (Health_Perf)    / Foreign("XHJ","Close",fixup=1);
N_Tech_Perf      = (Tech_Perf)      / Foreign("XIJ","Close",fixup=1);
N_Finance_Perf   = (Finance_Perf)   / Foreign("XFJ","Close",fixup=1);


Energy_Sum        = Sum(N_Energy_Perf,Sum_Filter);
Materials_Sum     = Sum(N_Materials_Perf,Sum_Filter);
Consumer_Discret_Sum     = Sum(N_Consumer_Discret_Perf,Sum_Filter);
Health_Sum          = Sum(N_Health_Perf,Sum_Filter);
Tech_Sum          = Sum(N_Tech_Perf,Sum_Filter);
Finance_Sum       = Sum(N_Finance_Perf,Sum_Filter);


Plot (Energy_Sum,"Energy",colorGrey50,styleLine);
Plot (Materials_Sum,"Materials",colorGreen,styleLine);
Plot (Consumer_Discret_Sum,"Consumer_Discret",colorlightBlue,styleLine);
Plot (Health_Sum,"Finance",colorYellow,styleLine);
Plot (Finance_Sum,"Finance",colorred,styleLine);
Plot (Tech_Sum,"Tech",colorWhite,styleLine);

//MaxGraph = 4;
//Graph0 = Energy_Sum;
//Graph0Color = colorAqua;      //Aqua - Energy
//Graph1 = Tech_Sum;    
//Graph1Color = 2;      //White - Tech
//Graph2 = Finance_Sum;
//Graph2Color = 4;      //Red - Finance
//Graph3 = Materials_Sum;
//Graph3Color = 5;      //Green - Mater.

/*
Backtest performance by selectig top sector to buy
Buy when rel performance above 0 and slope maximum
Sell when slope decreass relative to another sector
Always be in the market
*/



//Filter = Close > 0;
//NumColumns = 4;
//Column0Name = "Energy";
//Column0     = Energy_Sum;
//Column1Name = "Tech";
//Column1     = Tech_Sum;
//Column2Name = "Finance";
//Column2     = Finance_Sum;
//Column3Name = "Materials";
//Column3     = MAterials_Sum;


_SECTION_END();
 
Hi All,

I'm currently trying to code a trading system around the London open for the British Pound.

The idea is that the system uses hourly data to buy a break above the highest high over the prior five hours of trading. The buysetup is at 6:59pm Sydney time and remains valid for three hourly bars after this, long only at this stage.

This is quite a messy looking piece of code but it does do what I'm after. I'm just wondering if there is any easier way to write this in the looping.

tn = TimeNum();
startTime = 180000; // start in HHMMSS format
endTime = 190000; // end in HHMMSS format
timeOK = tn >= startTime AND tn <= endTime;

BuySetUp = timeOK;

OrderPrice = PeriodHigh + Stretch;

LE = (Ref(BuySetUp,-1) AND H >= Ref(OrderPrice,-1)) OR (Ref(BuySetUp,-2) AND H >= Ref(OrderPrice,-2)) OR (Ref(BuySetUp,-3) AND H >= Ref(OrderPrice,-3));


LEPrice = IIf(Ref(BuySetUp,-1),Ref(OrderPrice,-1),IIf(Ref(BuySetUp,-2),Ref(OrderPrice,-2),Ref(OrderPrice,-3)));

Appreciate any help,

James
 
Hi James --

Pick a specific time from which to do all your analysis. Think ahead to how you would trade the resulting system and be certain the transition from analysis to trading can be done without complications.

Try to avoid Ref as much as possible. Also try to avoid SetTradeDelays to anything other than 0.

Translate everything to that specific time before starting to develop the system. My preference is to imagine myself at the moment I have all the information I need to place my order. If you will be trading market-on-close of the bar that gives the signal, be certain all the information you need is available at that time. If you will be entering orders for later execution -- market-on-open, limit order, stop order, etc -- you have more flexibility in choice of time.

Best regards,
Howard
 
Morning Howard,

Thank you for taking the time to respond, much appreciated.

Just to clarify, in terms of avoiding using Ref as much as possible I should write this out as looping instead?
Everything calculated as of 6:59pm (Sydney time) where I calculate the highest high value and lowest low value over the Asian session, placing a stop buy & stop sell orders two pips above and below respectively to try to enter on a volatile breakout of the Asian range.

Many thanks,

James
 
Hi James --

You will have choices of whether to use Ref or to use looping code. And what time reference point to use for the calculations.

My advice is to pick a reference time. Perhaps the time that corresponds to the time you will be gathering data and computing signals.

I find it helpful to draw a diagram with a bar chart and put a star at that point. Then describe the data and compute the indicators, evaluate the rules, and issue the signals. Be particularly careful if you will be setting trade delays to anything other than 0. Use either Ref or looping code with adjustments to the indexes to reference previous bars -- which ever best fits your situation and coding preference. Work for clarity first, verifying the system works as you want it to. Only then, and only if you need it, consider processing speed.

Best regards, Howard
 
Just a thought:


Bull candle time WRONG OUTPUT (use exploration and see it)


We try to compare 1 min . and 15 min. candle close
Of course we're not going to change setting, it's default 1 minute.
Now if we do exploration, it gives wrong output for 15 min.
We only looking for bull candle close time.


For 1 min. working fine as default settings is 1 min.
Use Code below

Code:
Code:
bull= C>O;
Filter=bull;
dt = DateTime();
AddColumn( dt, "Date", formatDateTime );
AddColumn( bull, "Signal", formatChar );

0EAmhI6.png

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
 
Just a thought:


Bull candle time WRONG OUTPUT (use exploration and see it)


We try to compare 1 min . and 15 min. candle close
Of course we're not going to change setting, it's default 1 minute.
Now if we do exploration, it gives wrong output for 15 min.
We only looking for bull candle close time.


For 1 min. working fine as default settings is 1 min.
Use Code below

Code:
Code:
bull= C>O;
Filter=bull;
dt = DateTime();
AddColumn( dt, "Date", formatDateTime );
AddColumn( bull, "Signal", formatChar );

0EAmhI6.png

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

Purchase AmiBroker (finally) then go to Marcin or Tomasz at support channel to get explained the mistakes you are doing.
 
Hey

How can I extend the y Grid axis in the background to extend for future dates? You know, the y lines that match up the dates on charts.

If i can the y lines extended it would make my life a whole lot easier to predict future prices with the x axis..

Hope that makes sense
 
Hey

How can I extend the y Grid axis in the background to extend for future dates? You know, the y lines that match up the dates on charts.

If i can the y lines extended it would make my life a whole lot easier to predict future prices with the x axis..

Hope that makes sense

x axis - tools > preferences > charting > blank bars in right...


"To move Y-axis scale hover the mouse to Y-axis area (marked with blue color in the picture above) and you will see that cursor changes to up/down arrow. Now you click and drag up/down Y axis and release button when the axis is in the correct position.

To shrink/expand Y-axis scale: press down SHIFT key and click in the Y-axis area, now shrink/expand Y axis scale by moving your mouse up and down. Release the button to finish.

To reset Y-axis scale and position simply double click in the Y-axis area".


in italics taken from AB help.
 
Top