| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Simple Shelley Backtester https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=606 |
Page 6 of 6 |
| Author: | NeoTrader [ Tue Jul 10, 2012 5:35 am ] |
| Post subject: | Re: Simple Shelley Backtester |
hmmm...I don't think that we should involve a third tool that most of the people don't have installed on their computer...I will try to do it as a MQL Script or a Windows shellscript. Why don't we use a Parameter "backtester" that can be set to true/false. In the library I just make a simple check with "if (backtester) { function override } else { original function }". This way we only need to rename the functions once for every EA and then use only the BT_XXX functions in the Indicator and in the EA. I think this would be a much easier and cleaner solution then renaming the functions every time we want to add or change something. Just a thought. Yep, that sounds plausible, clean and easy to implement... me likey.. Yeah ...they will sure come up...especially with Empty4.. hehe...yes you really should...I'm used to subversion but I think that I will jump on the Git train this time. Bitbucket seems to be ok...I will setup an account with them. I found also a nice client for it at http://code.google.com/p/gitextensions/ . This has also a explorer shell extension...like tortoise svn. Aaaargh...but I thought so already... ok... the I will see how far I get.. thanks for your comments and insights... happy trading, NeoTrader - |
|
| Author: | garyfritz [ Tue Jul 10, 2012 12:54 pm ] |
| Post subject: | Re: Simple Shelley Backtester |
Oh yes, I would make the change once (or write it that way originally) and leave it that way. I had thought we would have two different libraries, one with "wrapper pass-through" functions for the EA, and one that implemented the backtester logic. Then you'd just change the #include when you wanted to run the backtester. That way you're not carrying around the backtester code when you're just running the EA. |
|
| Author: | NeoTrader [ Tue Jul 10, 2012 3:05 pm ] |
| Post subject: | Re: Simple Shelley Backtester |
yep...this is actually more elegant...I will do it that way...thanks for your input... I will also try to do a visualization of the trades like the zigzag demo in the Article I send before. Maybe as a optional parameter in the EATestIndicator. I'm also thinking to write a MQL Script that could collect all the relevant Account Informations on the local Empty4 and write it to a file as if they where external Parameters so we can copy and paste or read this Information in the EATestIndicator and can use them also in the BT_Functions. If we would copy&paste them as external Parameter the user also would have the possibility to change some of it to his needs. what do you think about this features? happy trading, NeoTrader - |
|
| Author: | garyfritz [ Tue Jul 10, 2012 3:12 pm ] |
| Post subject: | Re: Simple Shelley Backtester |
That would be fabulous. I find that to be an invaluable debugging aid with TS. Meaning, you'd read the current account value, and use that actual account value in the backtest? Personally I wouldn't bother. When I backtest a system I don't care what my current actual account value is. I just want to know how the EA performas. Just let the user specify a reasonable starting value, and simulate it from there. |
|
| Author: | NeoTrader [ Tue Jul 10, 2012 4:02 pm ] |
| Post subject: | Re: Simple Shelley Backtester |
I also thought so... It is not about the Account Value...that is something we can put any value in but we have following Functions that needs to be accurate for the EAs.
The Script just would call every function and write it in a file as extern *type* BTfunctionVariableName = ResultOfFunctionCall; We then just open the generated File and could have all parameters that we just copy and paste in a reserved Area of the external Parameters in our EATesterIndicator. You would still have the possibility to change certain values manually and our BT_AccountFunctions could gather and work with realistic Data. This is nothing you need to do every time...only the first time with a new account...put it in the EATesterIndicator and use this as Template for all your following EA Tests. Do you think that this is reasonable? Or am I thinking to complex again... happy trading, NeoTrader - |
|
| Author: | garyfritz [ Tue Jul 10, 2012 6:44 pm ] |
| Post subject: | Re: Simple Shelley Backtester |
I see what you mean. I have no idea how much those get used. But yes, it would probably be a good idea to provide reasonable values for those vars. |
|
| Author: | MadCow [ Thu Jul 12, 2012 5:59 pm ] |
| Post subject: | Re: Simple Shelley Backtester |
Hi guys. You seem to be taking on a pretty daunting task. It is sorely needed, and I am surprised it has not been done, given the Strategy Tester limitations. Hope you are successful. :!: You can simplify it a little, since the Empty4 indicators respond correctly to all the accountxxx() calls. In fact the indicators respond correctly to all the calls I have used, except the trading functions. (But I don't use some of the calls). You might consider writing a DLL that would have two classes. A Trades class that held all the trades, and their parameters, and an Accounts class that kept track of the profit/loss. Although many EA's don't really use the accounts info, some calculate the position size based on the account balance and desired risk. The balance will not change in the account called directly from the indicator, so you need to track it in an array. The problem I have found with DLLs is the way that Empty4 handles them. I'm not a pro like you guys, so maybe I am just having an amateur problem, but it seems that Empty4 must do all the static memory allocation, and pass the address to the DLL, since if allocation is done in the DLL it is lost between DLL calls. That makes it tough to write a DLL with arrays that change size, but it can be done in simple cases, so probably can be done for your app. The community will really appreciate a multi-symbol backtester. |
|
| Author: | garyfritz [ Thu Jul 12, 2012 6:27 pm ] |
| Post subject: | Re: Simple Shelley Backtester |
Yes -- but those would be the REAL Accountxxx() calls, corresponding to the REAL account -- not the simulated account in your backtest! If somebody's accessing e.g. AccountEquity(), he probably wants to know the equity resulting from the current EA execution -- which means we have to simulate it and report he simulated account balance. Nice try though. |
|
| Author: | MadCow [ Sat Jul 14, 2012 6:31 pm ] |
| Post subject: | Re: Simple Shelley Backtester |
Of course. That's why you would need either an Accounts class or an Accounts array in case the EA accessed a variable that changed due to virtual trading. I should have been clearer. |
|
| All times are UTC | Page 6 of 6 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|