Australian (ASX) Stock Market Forum

Amibroker FAQ

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?
 
Hiya,

Anyone have some code for: "last low pivot > low pivot prior"?

I've tried adapting some pivot codes using ValueWhen, but it just ain't workin'.

Ideas?

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);
 
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.
 
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.

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.
 
As it is the filter you are suggesting just becomes another condition.

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.
 
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.

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.
 
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.
 
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.

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.
 
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.

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
 
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.
 
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.

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.
 
Hi all,

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

Cheers,
 
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();
 
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);
 
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
 
It seems ok until the volume and turnover are added and the I get nothing. Are these amounts too much? The filter is
//Minimum Volume is when 21 Day average Volume exceeds 500,000 Shares
//Minimum Turnover is when 21 Day average Turnover exceeds $500,000 Dollars.

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.
 
Top