Modify spread for training/testing

Posted By: Radar

Modify spread for training/testing - 01/14/14 08:14

Hey Gang,

Just wondering if there's a way to set/modify the spread for training and testing a system.

My way of thinking might be crazy, but I want to train/test any systems against double my broker's average spread, to give me a more reasonable expectation of trading results.
Posted By: jcl

Re: Modify spread for training/testing - 01/14/14 09:34

For a spread of 10 pips:

Spread = 10*PIP;
Posted By: Radar

Re: Modify spread for training/testing - 01/14/14 10:46


Ok... Silly question number two...

Where, exactly, would I put that?
Posted By: blaub4r

Re: Modify spread for training/testing - 01/14/14 14:00

Inside the run function, at the beginning before you open any trades
Posted By: dusktrader

Re: Modify spread for training/testing - 01/14/14 14:25

There is another way that I like better: create a custom AssetFix.dta file for your simulation. The reason you would want to do this is so you don't have to answer the question of "what is my spread now?" which you would need to know if you were creating a crippled spread like you suggest (which btw I think is a GREAT line of thinking, not crazy at all)

This method is especially helpful if you are managing more than a handful of assets:

1) First let Zorro create your Assets.dta file and include all the assets you will use. In my case, I track 27 assets that are available in the 2 brokers I most primarily use. You can get Zorro to add the entries into Assets.dta (as well as download the actual history data) using the Download.c script

2) Then make a copy of Assets.dta and name it something meaningful like "Assets-FXCMmicro-spread100.dta" (this is my 100% spread-crippled simulation)

3) Open your copy of the .dta file with a spreadsheet program using (space) as the delimeter

4) In your spreadsheet program, apply whatever multiplier factor you want on the Spread column (3rd column)

5) In your Zorro script, use a command like this to tell Zorro to use the crippled spread file. I like to build strategies using the actual spread simulation, then do a final check with the crippled spreads.
Code:
AssetList = "Assets-FXCMmicro-spread100.dta";

Posted By: Radar

Re: Modify spread for training/testing - 01/14/14 15:33

Thanks Blaub4r & Dusktrader,

Looks like the next step for me then, is to code it so it creates a copy with adjusted spread automatically after downloading history, and on the fly when getting ticks from the broker or mt4.

© 2024 lite-C Forums