Hello Experts,
I do my analysis based on EOD data & basis my EOD analysis I take positions next day. Whether I need to initiate a new position (Buy or Short) or I need to close my existing position (Sell or Cover) I use the same methodology. I have built a trading system & it is giving me great results on scan basis however, I want to backtest this strategy with proper rules.
Can someone help me with the backtest settings in Amibroker for EOD analysis? Here are some details -
My capital is 20 lakhs
I can take 2% risk on my deployed capital in each trade as max stop loss
I plan to keep only 1 position at a time (will increase quantity)
For buy trigger I want to buy only if previous day high is broken. Similarly for short positions, I want to initiate a short if previous day low is broken
I am new to this so your help will be really helpful. I am happy to share few trading systems post backtest if the results are good. I am sure this will help a lot of people.
If you scroll down to about half way, you can see screen shots of the backtester settings.
You can set periodicity to "Daily" #1 your capital is in the field "initial equity" #2 your Stop Loss / targets can be defined under the 3rd tab called "Stops" #3 Max open positions can be defined in 5th tab under "Portfolio" #4 Entry / Exit rules defined in the AFL file
AB is an advanced tool, and it has a very detailed KB and guide.
The only way you can get around is by reading / learning and testing.
These stages cannot be done by hand-holding and i'm sure you get the point.
also, you would like to check some guidelines here:
To begin with, this section of the User Guide Back-testing your trading ideas contains the fundamentals and from here you should be able to construct the settings as per your requirements.
Then there are numerous KB (Knowledge Base) articles on the subject. Let me Google it for you - click here.
You can also search this forum too (link), or visit the "AFL Programming" > "backtest" tag to read some discussions and exchange of ideas that must help you in the long run.
To add, the internet is filled with books, websites, courses on this subject - all waiting for you to discover!
Thank you
P.S. A bit off-topic, however essential! Are you aware of the "help vampire" phenomenon? Please read along.
Thank you Travick for your prompt response. Much appreciated!
These tricks have really helped me & I was able to backtest my trading idea perfectly.
I am doing individual stock backtesting (not in portfolio mode with multiple stocks) & the only problem I am facing is that signals are not coming proper. Ideally after every Long, I should get a Sell signal to close my position and after every Short I should get a Cover signal to close my position but I am getting distorted signals. I only see Long & Short signals and dont see Sell and Cover. Can you help? Thanks in advance.
You have not read carefully the posts on How To. If you want help, you need to provide ALL details including code and Backtester settings.
People here are unable to read minds and remote computers yet.
Thank you so very much Cougar for your kind response to help me out here. I sincerely appreciate it. Based on your help I was able to backtest my idea & it worked well. The only issue I face is that I am getting continuous Long or Short signals rather than coming one after other to square off open position. Any guidance to overcome this challenge would be highly appreciated. thanks a ton in advance.
Every line in the report has data about a full operation (compounded of two "actions": BUY and the corresponding SELL, or SHORT and the corresponding COVER):
The first column is the operation type: "Long", for BUY/SELL operation, and "Short" for SHORT/COVER.
Columns 2, 3 (Date, Price): Shows the date and price for BUY or SHORT.
Columns 4, 5 (Ex. Date, Ex. Price): Shows the date and price for SELL or COVER
Thank you so much LeoCV for your help. Yes I overlooked the results & I thought one line has only 1 result whereas it was a complete trade (Buy/Sell, Short/Cover). No further questions on this.