- Joined
- 7 June 2007
- Posts
- 28
- Reactions
- 0
Try changing you filter to the following, then your ExRem will work
Filter = Buy;
StartDate = "2014-01-07" ;
StartClose = Lookup( C, _DT( StartDate ), 1 ) ;
Buy = C > (startclose * 5);
Sell = 0;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Filter = Buy AND StrLen( Name () ) == 3;
AddColumn(C > startclose * 5,"fivetimes",5);
AddColumn(Close,"Close 30/6/2018",1.4);
AddColumn(startclose,"close 1/7/2014",1.4);
AddColumn(startclose*5,"start * 5",1.4);
This is way harder than it should be
I get
View attachment 98121
Code:StartDate = "2014-01-07" ; StartClose = Lookup( C, _DT( StartDate ), 1 ) ; Buy = C > (startclose * 5); Sell = 0; Buy = ExRem(Buy,Sell); Sell = ExRem(Sell,Buy); Filter = Buy AND StrLen( Name () ) == 3; AddColumn(C > startclose * 5,"fivetimes",5); AddColumn(Close,"Close 30/6/2018",1.4); AddColumn(startclose,"close 1/7/2014",1.4); AddColumn(startclose*5,"start * 5",1.4);
I see you have a filter applied AC8 is in the All Industries watch list, try selecting All symbols
and you are limiting search to dates try all quotes. then we can move forward
Okay,
With Exrem on, using all symbols and all quotes AC8 is picked up but only in 1999 -which is correct - first instance only. If I set the date range to 2014-2018, then AC8 is rejected, but only when Exrem is used. Image is with exrem commented out. Note the 2017 AC8 entries are included.
View attachment 98123
Okay,
With Exrem on, using all symbols and all quotes AC8 is picked up but only in 1999 -which is correct - first instance only. If I set the date range to 2014-2018, then AC8 is rejected, but only when Exrem is used. Image is with exrem commented out. Note the 2017 AC8 entries are included.
The ExRem function removes excess signals. ExRem( Buy, Sell ) means you will get one buy signal then nothing until you get a sell signal then nothing until you get a buy signal and so on. You have a Sell rule but it will never be true so you will only ever get a single buy.
Your Buy rule is comparing the close price on your start date with every close price through history and the first time that happened was 28-Jan-1999. Even when you set the date range to be 2014-2018 Amibroker still knows the first buy signal was in 1999.
With the ExRem function Amibroker knows you had a buy signal before the start of your date range so will not display the symbol until you get a sell signal (which you never get) then the next buy signal...
Two changes you could make are add a valid sell signal and filter buy and sell signals to dates after your start date. Something like
StartDate = "2014-01-07" ;
StartClose = Lookup( C, _DT( StartDate ), 1 ) ;
Buy = Close > ( startclose * 5) AND DateTime() >= StrToDateTime( StartDate ) ;
Sell = Close < ( startclose * 4.5 ) AND DateTime() >= StrToDateTime( StartDate ) ; ;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Filter = Buy ;
A scan of AC8 should return
View attachment 98126
Suggest to read about OOS (out of sample/walk forward testing) and read some of Howard Bandy's books. Howard used to contribute here, try the search function.Hi All, I am very new amibroker user, I’ve been experimenting with some simplistic back testing on asx historical equities. I have a query around recommended position sizing methods during back testing and would greatly appreciate any guidance or reference to historical threads that would have discussed this in the past.
Initially I was using a fixed percentage of capital and a maximum number of open positions as an input but with 100k starting capital and 5pct capital allocation per trade the trade size grows over long testing periods to what seems unrealistic levels to me. As a counter to this I run a fixed $ amount per trade as an input with an increase to the maximum number of open positions.
Over the same system the fixed $ amount per trade approximately halves CAGR versus the 5pct capital allocation.
I would be greatful to hear if I’m way of the mark with this kind of approach to position sizing in terms of good practice to generating back testing results and any other recommended methods I could investigate.
Will take a look, thanks joe90
Also read up on the following as this may help with some of those unrealistic trade sizes that would move the market
View attachment 98566
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?