- Joined
- 13 June 2007
- Posts
- 838
- Reactions
- 136
TimeDayNum = Day();
TimeDayName = DayOfWeek();
TimeDaysToFriday = ( 5 - TimeDayName + 7 ) % 7;
TimeFridayCount = floor( ( TimeDayNum + TimeDaysToFriday + 6 ) / 7 );
TimeThirdFridayDate = TimeDayNum + TimeDaysToFriday + ( 3 - TimeFridayCount ) * 7;
TimeThirdFriday = TimeDayNum == TimeThirdFridayDate;
Plot( TimeThirdFriday, "TimeThirdFriday", colorGreen );
Help! I am trying to plot an indicator that flags every third Friday (or the closest previous trading day) in a month. I have gotten so far but have identified that in some months (see list below) the indicator isn't picking the closest day to the third Friday of the month. Any help appreciated.
Problem months:
April 2014
March 2008
April 2003
April 2000
April 1997
April 1992
April 1984
April 1981
The problem is to do with Easter it seems.
Code:TimeDayNum = Day(); TimeDayName = DayOfWeek(); TimeDaysToFriday = ( 5 - TimeDayName + 7 ) % 7; TimeFridayCount = floor( ( TimeDayNum + TimeDaysToFriday + 6 ) / 7 ); TimeThirdFridayDate = TimeDayNum + TimeDaysToFriday + ( 3 - TimeFridayCount ) * 7; TimeThirdFriday = TimeDayNum == TimeThirdFridayDate; Plot( TimeThirdFriday, "TimeThirdFriday", colorGreen );
TimeDayNum = Day();
TimeDayName = DayOfWeek();
TimeDaysToFriday = ( 5 - TimeDayName + 7 ) % 7;
TimeFridayCount = floor( ( TimeDayNum + TimeDaysToFriday + 6 ) / 7 );
TimeThirdFridayDate = TimeDayNum + TimeDaysToFriday + ( 3 - TimeFridayCount ) * 7;
TimeThirdMonday = Cross( TimeDayNum, TimeThirdFridayDate );
Plot( TimeThirdMonday, "TimeDayNum", colorRed );
My intention is to pick the third Friday and trade on the Monday. I have checked my code, it seems fine to me. Your code is picking the fourth Monday in January and April some years for me.
Buy = RSI(3) < 50;
PositionScore = ROC(20); // 20 week ROC
SetOption("MaxOpenPositions", 10);
Code:Buy = RSI(3) < 50; PositionScore = ROC(20); // 20 week ROC SetOption("MaxOpenPositions", 10);
Hello
Still working on coding my first system. Results are starting to look promising although more checks needed
Annual Return on backtesting 15% with a 14% drawdown
Looking at excluding top 99 stocks (large Cap) by Market Cap
Some help how I would do that as running into a brick wall
Thanks all
Thanks Boggo will work which list is best to work withAre you running Premium Data ?
One of their advantages is the number of lists they produce.
I find that the All Ords (around 500 stocks) is a good list to work with, gets rid of the chaff but still gives you a broad selection of prices and sectors.
.
View attachment 70825
Are you running Premium Data ?
One of their advantages is the number of lists they produce.
I find that the All Ords (around 500 stocks) is a good list to work with, gets rid of the chaff but still gives you a broad selection of prices and sectors.
.
View attachment 70825
Quick question. Why do you want to exclude the top 100? Is it due to lack of profit potential/volatility or something?
If this is the case I see it as an overly simplistic approach. Try leaving the top 100 in and using an appropriate filter instead of cutting out a big block of potential trade candidates. However I do agree that in general sticking to the ASX500 is sound. A significant number outside of the ASX500 is untradable with any sort of decent size. With that said, a thought that I had recently was that if I could filter for market cap. inside AmiBroker using code I would look closely at adopting that approach and dumping S&P lists all together.
I will mention that I run multiple systems that trade short term and they all select trades from S&P lists. I found that in general the majority (but certainly not all) of ASX100 candidates exhibit very different characteristics to those outside that universe when tested using my systems. I put this down to volatility and the market participants that trade in this end of the pool. However my systems that trade the ASX300 or ASX500 never exclude the ASX100 or ASX200 for example. There are some great trades to be had there with good volatility and profit potential.
So what I am trying to highlight is that in my experience filtering from the top down (eg ASX200, ASX500) works well, but filtering from the bottom up (eg ASX300 excluding ASX100) isn't the best thing to do. All it does is limit you opportunity.
Something to try out.
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?