Australian (ASX) Stock Market Forum

Trend Detection Indicator

Ive got the first one sorted.

If someone can help me with the second one one I would really appreciate it.
I need it to give just one buy signal not 2.

http://i409.photobucket.com/albums/p...0SMA/20SMA.png



Range1=Optimize("range1",20,20,50,1);


Buy = Close > Ref( MA( Close , Range1 ) , -2 )
AND MA( Close , 20 ) > Ref( MA( Close , 20 ) , -1 ) ;


Sell = MA( Close , 20 ) < Ref( MA( Close , 20 ) , -2 ) ;


Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
 
For EOD exploration and using a long moving average. The problem with the long MA is the share price can be on it's way down before the long MA starts to decline. However, issues with this exploration can be chopped at discretion.

You may want to move away from a MA as trending tool but most tools have their use.

PHP:
DE = DEMA(C, 200) > Ref(DEMA(C, 200), -1);
SH = StochK() > 20; 
SL = StochK() < 30;
SU = StochK() > Ref(StochK(), -1);

Buy = DE && SH && SL && SU;
Sell = 0;

Filter = Buy;
AddColumn(Buy, "Let's Rock", 1.2, 24, 43, -1);

Thats a great bit of code. Thanks :) I suppose I could just alter for a sell below 80?
 
Thats a great bit of code. Thanks :) I suppose I could just alter for a sell below 80?

I tried setting the sell to trigger by turning down from above 80. It works most times but its one of the reasons I havent really used the stochastic. A lot of times it doesnt make it to 80 so I dont get a sell signal. What do you use for a sell then? Trailing stop?

Sorry if this seems pretty basic :):)
 
Hi pennies. Yes you are right the 80 does not get crossed all the time with those parameters so why not add another exit? The trailing stop may well be the exit that fits all trades but not always.

I try to keep the entry and exit criteria simple. Prices go up or down or stay the same.
 
If your using a cross of 80 in stochastic as a sell signal then your using stochastic in correctly.
Stochastic signals are only taken in the Direction of the trend.
 
Hi pennies. Yes you are right the 80 does not get crossed all the time with those parameters so why not add another exit? The trailing stop may well be the exit that fits all trades but not always.

I try to keep the entry and exit criteria simple. Prices go up or down or stay the same.

Im trading over periods of a few days to several weeks. What types of stops work most effectively for this type of trading? Ive tried various moving average crossovers but they lag a lot and I give back a lot of profit. Trailing stops seem to have to be set at aound 5% to keep me in longer trends. I havent tried ATR although Im currently reading about it. Do you have any suggestions?

Also RE: Tech/A

"If your using a cross of 80 in stochastic as a sell signal then your using stochastic in correctly.
Stochastic signals are only taken in the Direction of the trend."

Isnt a sell signal triggered when the stochastic has been above 80 and then closes below it?


Thanks
 
No it indicates over bought not sell.


From here

http://stockcharts.com/school/doku....icators:introduction_to_tech#oscillator_types


Banded oscillators are designed to identify overbought and oversold extremes. Since these oscillators fluctuate between extremes, they can be difficult to use in trending markets. Banded oscillators are best used in trading ranges or with securities that are not trending. In a strong trend, users may see many signals that are not really valid. If a stock is in a strong uptrend, buying on oversold conditions will work much better than selling on overbought conditions

Its important to understand how to use and interpret indicators in this case your attempting to use an indicator which is designed for Range trading signals to identify trends!!
Not particularly helpful in your pursuit.
 
Im trading over periods of a few days to several weeks. What types of stops work most effectively for this type of trading?
Thanks
Apart from the initial stop to fix loss if the trade goes against, I don't know of any most effective stop. Perhaps someone else does????
 
As I understand the question placed here you are looking for a method of TREND DETECTION as against trend identification.

Which makes sence---you want to get on an emerging trend not confirm that a trend is indeed in place.

That being the case price action itself is the best I have found.
Higher highs and higher lows.
Those who have looked into this in more depth will also find identification of Wave 3 setups in Elliott Wave Analysis handy.

Learning how to count waves will be benificial.
This helps you see the structure of a chart.
 
For EOD exploration and using a long moving average. The problem with the long MA is the share price can be on it's way down before the long MA starts to decline. However, issues with this exploration can be chopped at discretion.

You may want to move away from a MA as trending tool but most tools have their use.

PHP:
DE = DEMA(C, 200) > Ref(DEMA(C, 200), -1);
SH = StochK() > 20; 
SL = StochK() < 30;
SU = StochK() > Ref(StochK(), -1);

Buy = DE && SH && SL && SU;
Sell = 0;

Filter = Buy;
AddColumn(Buy, "Let's Rock", 1.2, 24, 43, -1);

Can you please tell me what && means in AFL. Is it AND?

Im wondering how I get a buy signal when the stochastic is above 30 and turns up. The way I read that formula it tells me the the stochastic is between 20 and 30 and heading up. Is that right. Curious as to why I get a buy signal when the stochastic only made it down to 43 and didnt get to between 20 and 30 :confused:


http://i409.photobucket.com/albums/pp175/pennies_08/Stochastic/Stochastic.png
 
Can you please tell me what && means in AFL. Is it AND?

Im wondering how I get a buy signal when the stochastic is above 30 and turns up. The way I read that formula it tells me the the stochastic is between 20 and 30 and heading up. Is that right. Curious as to why I get a buy signal when the stochastic only made it down to 43 and didnt get to between 20 and 30:confused:
From the example code ---- yes && is AND and my signals are generated exactly as the circumstance occurs. That is, it does as the code states. Amibroker does what the code says otherwise 99% of the time it is human error. :)
 

Attachments

  • untitled.jpg
    untitled.jpg
    70.7 KB · Views: 8
From the example code ---- yes && is AND and my signals are generated exactly as the circumstance occurs. That is, it does as the code states. Amibroker does what the code says otherwise 99% of the time it is human error. :)

Yours seems to be fine. Mine on the other hand....

DE = DEMA(C, 200) > Ref(DEMA(C, 200), -1);
SH = StochK() > 20;
SL = StochK() < 30;
SU = StochK() > Ref(StochK(), -1);

Buy = DE && SH && SL && SU;

Was I supposed to put values in the brackets for the stochastic code above? It looks like ithe signals on my chart work well on the price but they dont seem to be right on the stochastic.

Stochastic.png
 
I just use a simple formula (see chart) which changes the colour of the bars on my default template to give me a bit of a heads up of a potential change of direction.

(click to expand)
 

Attachments

  • OB and OS.png
    OB and OS.png
    69 KB · Views: 14
Was I supposed to put values in the brackets for the stochastic code above? It looks like ithe signals on my chart work well on the price but they dont seem to be right on the stochastic.
My stoch %K standard settings are 15,3. You have 15,5. :)

Note the code is my beginners effort.
 
I just use a simple formula (see chart) which changes the colour of the bars on my default template to give me a bit of a heads up of a potential change of direction.

(click to expand)
Hi, Could you post the pre March 2009 chart. March 2008 to March 2009. Thanks.:)
 
Whats with this fanatical devotion to Stochastic?
Total in difference to other suggestions?
 
Tech/a,

That being the case price action itself is the best I have found.
Higher highs and higher lows.

Absolutely agree, all this other fancy stuff is just there to confuse.

Whats with this fanatical devotion to Stochastic?
Total in difference to other suggestions?

It appears to be a sign of learning. Most seem to go through different stages of needing 'indicators' or some other such. People seem to need the crutch until they are either out of the market by blowing up, or a survivor.

brty
 
Top