• Australian (ASX) Stock Market Forum

Hello and welcome to Aussie Stock Forums!

To gain full access you must register. Registration is free and takes only a few seconds to complete.

Already a member? Log in here.

Amibroker FAQ

Discussion in 'Software and Data' started by RichKid, Jul 15, 2005.

  1. Gringotts Bank

    Gringotts Bank

    Posts:
    6,175
    Likes Received:
    602
    Joined:
    Jun 30, 2007
    Ahoy Cap'n.

    Like so:

    ////E.M.Pottasch 09/06/10
    SetBarsRequired(sbrAll,sbrAll);
    nbar = 5;//Param("nbar",2,2,50,1);
    PHigh = H > Ref(HHV(H,nbar),-1) AND Ref(HHV(H,nbar),nbar) < H;
    PHighPrice0 = ValueWhen(PHigh,H);

    PHighPrice1 = IIf(PHighPrice0 AND BarsSince(PHigh) > nbar,PHighPrice0,Null); PHighPrice2 = IIf(PHighPrice0 AND BarsSince(PHigh) <= nbar,PHighPrice0,Null);

    PLow = L < Ref(LLV(L,nbar),-1) AND Ref(LLV(L,nbar),nbar) > L;
    PLowPrice0 = ValueWhen(PLow,L);
    PLowPrice1 = IIf(PLowPrice0 AND BarsSince(Plow) > nbar,PLowPrice0,Null); PLowPrice2 = IIf(PLowPrice0 AND BarsSince(Plow) <= nbar,PLowPrice0,Null);
    _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));

    GraphXSpace = 5;
    SetChartOptions(0, chartShowDates);
    Plot(C,"\nLast",colorWhite,styleCandle);
    PlotShapes(shapeSmallCircle*PLow,colorGreen,0,L,-10);
    PlotShapes(shapeSmallCircle*PHigh,colorYellow,0,H,10);
    PlotShapes(shapeUpArrow*PLow,colorGreen,0,L,-25);
    PlotShapes(shapeDownArrow*PHigh,colorRed,0,H,-25);

    Plot(PHighPrice1,"\nPHighPrice",colorYellow,styleThick);
    Plot(PHighPrice2,"",colorYellow,styleDots | styleNoLine);
    Plot(PLowPrice1,"\nPLowPrice",colorDarkGreen,style

    ------------------------------------------------------

    I tried ValueWhen(PLowPrice1,L,1)>ValueWhen(PLowPrice1,L,2)

    No luck however. Any suggestions please?
     
  2. AlterEgo

    AlterEgo

    Posts:
    500
    Likes Received:
    7
    Joined:
    May 24, 2008
    Well if your definition of a low pivot is a bar with each bar either side of it having a higher low:

    LowPivot = L > Ref(L,-1) AND Ref(L,-1) < Ref(L,-2);

    HigherPivot = ValueWhen(LowPivot, Ref(L,-1), 1) > ValueWhen(LowPivot, Ref(L,-1), 2);
     
  3. boofis

    boofis

    Posts:
    587
    Likes Received:
    0
    Joined:
    Nov 7, 2010
    Just trying get a bit of a filter on for when I don't have enough money to fill all signals lol.
    Very simply:
    =RSI (14) * ADX (14) > ?
    Need help with the question mark. I'm not sure what values will be reasonable and which will be excellent etc.?
    Just trying to find which of the signals is moving fastest my direction really.
     
  4. tech/a

    tech/a No Ordinary Duck

    Posts:
    19,215
    Likes Received:
    3,212
    Joined:
    Oct 14, 2004
    Oh my.
    You need to Montecarlo test your method to be able to see what the standard deviation is between all possible trade scenarios.
    With a good system it wont matter which signals you take and which you leave.

    As it is the filter you are suggesting just becomes another condition.
     
  5. boofis

    boofis

    Posts:
    587
    Likes Received:
    0
    Joined:
    Nov 7, 2010
    Correct, but it's not a condition I want to consider unless a choice has to be made to exclude from the original conditions.

    re. it doesn't matter which signals you take and which you leave, I agree but lets use you as an example; lets say you scan the market using X parameters and came up with 2 signal stocks but could only choose one. Using your VSA techniques (outside of what you're already happy with in the parameters) you can see that one of those two is closer to a point of large resistance than the other. This doesn't change either of their eligibility in your trading, but you're forced to make a choice and so want to again try and increase your probability of success.
    Would it still not matter which you would choose as the parameters have come up with both, so both are equally likely?
    I think it would matter, but I've been wrong before lol.
     
  6. tech/a

    tech/a No Ordinary Duck

    Posts:
    19,215
    Likes Received:
    3,212
    Joined:
    Oct 14, 2004
    Two things
    (1) it wouldn't matter which one I took as I know that I have positive expectancy no matter which one I choose.
    (2) I would take the trade with best position sizing.
     
  7. boofis

    boofis

    Posts:
    587
    Likes Received:
    0
    Joined:
    Nov 7, 2010
    1. Positive expectancy is great when it comes to trials with a sample size large enough to let it validate. But to say that positive expectancy would give you both trades as equal is misleading imo. You may have a long term positive expectancy but that doesn't mean both of those would be equal and winning trades. Win% would be more indicative in this instance, no? And this is what I'm trying to get at. Any system with a positive expectancy obviously still has losing trades, so am trying to determine which of the two might get a higher winning% from the already generated positive expec. signals.
    2. Interesting, duly noted.
     
  8. tech/a

    tech/a No Ordinary Duck

    Posts:
    19,215
    Likes Received:
    3,212
    Joined:
    Oct 14, 2004
    No mention of equal expectancy
    The SYSTEM has positive expectancy regardless of which one I choose.

    Attempting to increase win rate from discretionary choosing of which trade " could " be more likely to be a winner defeats the whole purpose of developing a system.

    I think you'll fall for the mistake of trying to filter buy signals to a couple in the expectation that that will increase win rate.
    Doesn't happen.
     
  9. CanOz

    CanOz Home runs feel good, but base hits pay bills!

    Posts:
    11,531
    Likes Received:
    486
    Joined:
    Jul 11, 2006
    I'm a little confused here, he needs to make a choice anyway. Whats wrong with giving his edge an edge?

    I seem to recall that one of the gents that Nick interviewed in his new book did the same sort of thing...unless i miss interpreted it?

    CanOz
     
  10. boofis

    boofis

    Posts:
    587
    Likes Received:
    0
    Joined:
    Nov 7, 2010
    While I can see where the risk lies. I don't see how discretionary choosing of system signalled stocks will ruin the system, as I'm still taking system based positions? The only way it might ruin it is if I didn't take enough positions over time to let probability do its thing.
    Irrespective, they are valid points and I shall find out whether demise awaits in time.
     
  11. tech/a

    tech/a No Ordinary Duck

    Posts:
    19,215
    Likes Received:
    3,212
    Joined:
    Oct 14, 2004
    I did and do the same with TT I have 2 discretionary filters.
    I could be wrong but I thought you were adding a further condition.
    To filter out so many possible buy signals.
     
  12. sammy84

    sammy84

    Posts:
    844
    Likes Received:
    0
    Joined:
    Sep 11, 2008
    Hi all,

    How can I lock a pane to show the monthly price chart and the one above it showing the daily?

    Cheers,
     
  13. colion

    colion

    Posts:
    116
    Likes Received:
    0
    Joined:
    Aug 6, 2010
    Use the TimeFrameSet() function in the code for each pane.
     
  14. Gringotts Bank

    Gringotts Bank

    Posts:
    6,175
    Likes Received:
    602
    Joined:
    Jun 30, 2007
    As colion said, or if you're just scanning/exploring, go to AA>Settings>periodicity>weekly
     
  15. sammy84

    sammy84

    Posts:
    844
    Likes Received:
    0
    Joined:
    Sep 11, 2008
    Thanks colion and GB

    The timeframeset is what I was after.
     
  16. CanOz

    CanOz Home runs feel good, but base hits pay bills!

    Posts:
    11,531
    Likes Received:
    486
    Joined:
    Jul 11, 2006
    The Sentiment Zone Oscillator (Verified) from the May edition of TASC...enjoy.:)

    Code:
    _SECTION_BEGIN("Sentiment Zone Oscillator");
    Period = Param("Period",14, 1, 100, 1);
    R=IIf (C>Ref(C,-1), 1,-1);
    SP=TEMA (R, Period);
    SZO=100*(SP/Period);
    LongPeriod=30;
    Percent=95;
    HLP=HHV(SZO, LongPeriod);
    LLP=LLV(SZO, LongPeriod);
    Range=HLP-LLP;
    Prange=Range*(Percent/100);
    OB=LLP+Prange;
    OS=HLP-Prange;
    Plot(SZO, "Sentiment Zone Oscillator", ParamColor("SZO", colorBlack),styleThick);
    Plot(OB," O/B", ParamColor("Upper-Sell", colorRed),styleLine);
    Plot(OS," O/S", ParamColor("Lower-Buy", colorDarkGreen),styleLine);
    Plot(7,"7",colorBlack, styleNoLabel|styleDashed|styleNoTitle);
    Plot(-7,"-7",colorBlack,styleNoLabel|styleDashed|styleNoTitle);
    _SECTION_END();
     
  17. art27

    art27

    Posts:
    62
    Likes Received:
    0
    Joined:
    Jul 9, 2011
    Hi Everyone

    Im trying to improve my exploration by adding a liquidity filter. When I added this I dont seem to get any results over many years. Have I written something wrong? It seems ok until the volume and turnover are added and the I get nothing. Are these amounts too much? The filter is

    //Turnover AND Volume

    //Minimum Volume is when 21 Day average Volume exceeds 500,000 Shares
    //Minimum Turnover is when 21 Day average Turnover exceeds $500,000 Dollars.

    AvVol=MA(Volume,21);
    AvTurnover=MA((Close*Volume),21);



    Cond1=ROC(Close,130)>20;
    Cond2=AVVol>500000;
    Cond3=AVTurnover>500000;
    Cond4=Close>BBandTop( C, 20, 2 );

    Buy=Cond1 AND cond2 AND cond3 AND Cond4;
    Sell = Close<MA(Close,20);



    Buy=ExRem(Buy,Sell);
    Sell=ExRem(Sell,Buy);


    PlotShapes(IIf(Buy,shapeSmallUpTriangle,shapeNone),colorGreen,0,L,-15);
    PlotShapes(IIf(Sell,shapeSmallDownTriangle,shapeNone),colorRed,0,H,-15);

    Filter=Cond1 AND Cond2 AND Cond3 AND Cond4;
    AddColumn(Buy, "buy", 1.0);
     
  18. howardbandy

    howardbandy

    Posts:
    838
    Likes Received:
    93
    Joined:
    Jun 13, 2007
    Hi Art --

    Try plotting each of the variables you are using as the new filter. That will show you how often they meet your criteria.

    Plot(AvVol,"AvVol",colorred,styleline|styleownscale);

    Thanks,
    Howard
     
  19. AlterEgo

    AlterEgo

    Posts:
    500
    Likes Received:
    7
    Joined:
    May 24, 2008
    No stock on the Australian Stock Exchange trades 500,000 shares per day - that's your problem. Why do you need both of those filters anyway? I'd just use the turnover filter and ditch the volume filter.
     
  20. CanOz

    CanOz Home runs feel good, but base hits pay bills!

    Posts:
    11,531
    Likes Received:
    486
    Joined:
    Jul 11, 2006
    :confused:

    Are you sure about that.......:rolleyes:
     
Loading...

Share This Page