- Joined
- 20 April 2016
- Posts
- 9
- Reactions
- 22
Many thanks Skate, you have been most generous with your time and expertise. So far, I have come up with the following draft code:
//Index Filter for XAO with a 200Day MA on a Daily Chart
Index = Foreign("XAO", "C", True);
IndexMA = MA(Index, 200);
Buy = C >= MA(C, 200) AND Index >= IndexMA;
Sell = C <= MA(C, 200);
//* Note I assume I need to add more code here to get some columns for a print out of where the XAO is crossing the 200Day MA. // Is that right? Am I on the right track? I appreciate the additional comments you have provided me. It is good to know that Joe Marwood is a local. I will endeavor to look closer at his resources.
Buy = C >= MA(C, 200) AND Index >= IndexMA;
Sell = C <= MA(C, 200);
A better buying condition is actually more along the lines of:
Sell = C <= MA(C, 20);
View attachment 103178
Disclaimer
The next graphic displays the hypothetical signals for Monday as the "Index Filter" is still turned off. There is "no way in hell" I would trade a strategy without protection - that would be foolish.
Sample of what to expect
So the system generates a sample of signals I'll use the hypothetical "Action Strategy" remembering that the "Index Filter is still turned off". With the Index turned off the strategy will generate buy signals when the entry conditions are met. Sell signals are not dependant on the Index Filter, meaning a sell signal is generated when the exit conditions are met.
View attachment 103179
There are 4 sell signals
There are 4 exit signals listed but as the "Action Strategy" only holds 2 of them (GOR & AGG) those two would be sold at open on Monday. Both (GOR & AGG) at this stage will be exited as winners.
For transparency
All the signals for the "Action Strategy" will be posted well in advance for transparency.
More to follow..
Skate.
The majority of us system traders don't buy based on dividend. You buy/sell when the signal is given. Any dividends are considering a cherry on top of hopefully a winning trade.
Hi @Skate , JMS have dividend this week - the price surge higher during and uptill the record date then price drop after that. Just to educate myself does the dividend alters your decision to when to buy/sell/hold? Like for this case JMS, does the above dates changes your position?
Does the sell off trigger a sell signal (after dividend)?
@Warr87 If a share bought based on system buy signal given and dividend came in line, Does the sell off that happen (if it happens) after dividend based on experience trigger a sell signal? (Caused by Dividend)
The reason I ask, I have encountered this multiple time overseas and not sure about ASX
@Skate thank for your eBook, it is very interesting read
@Warr87 If a share bought based on system buy signal given and dividend came in line, Does the sell off that happen (if it happens) after dividend based on experience trigger a sell signal? (Caused by Dividend)
The reason I ask, I have encountered this multiple time overseas and not sure about ASX
I think Peter2 used to adjust his systems to allow his stops to be lowered during the share price drop that happens on the ex-dividend date.
Amibroker is a blank sheet of paper, where you get to write the story! etc"
Many thanks Lone WolfAs Warr87 suggested, with the above code, in the rare event that the Close is exactly the same as the 200 MA you'll get both a buy and sell signal at the same time. Better to remove the = from it, or only include = in one of the two.
This is a good example of something that might not be obvious to Aristotle. (In fact I have code purchased long ago from a well-respected professional with a similar issue.) Let's say you used this sell signal with no other modifications:
Buy = C >= MA(C, 200) AND Index >= IndexMA;
Sell = C <= MA(C, 20);
This is what you get below. Orange line is the 200 MA, Green is the 20 MA. Price first crosses the 200 MA, you buy the next day (little green arrow), great. But look at what happens when price closes below the 20 MA. Every bar below the 20 MA is generating Buy and Sell signals at the same time. It's important to review your backtest trades to ensure the system is working as intended. Plot any indicators you use on the chart like in the image below so you can easily see where it should have taken a trade and whether it did.
View attachment 103204
Aristotle you could also look at tightening your trail stop instead of closing your positions. ie if you normally have a 30% trail stop then goto a 10% trail stop etc.“ time to close ones that are open”
Aristotle you could also look at tightening your trail stop instead of closing your positions. ie if you normally have a 30% trail stop then goto a 10% trail stop etc.
also you will find that it is common to have a ribbon on the bottom of the chart visually showing you index filter
Ribbon1=IIf( (indexWeeklyFilter) >= 1 , colorGreen,colorRed);
Plot(1, "Ribbon", Ribbon1, styleOwnScale| styleArea| styleNoLabel,-0.5,100);
View attachment 103236
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?