How to trade a different asset than that used for training?

Posted By: jmlocatelli

How to trade a different asset than that used for training? - 04/12/18 14:17

Hi,
How can I train a strategy using a certain asset history, and trade using a different asset?
The idea is to train using a continuous historic data and trade future contract with expiration date.
tks,
jm
Posted By: AndrewAMD

Re: How to trade a different asset than that used for training? - 04/12/18 14:37

You can construct a continuous futures series using contract data.

Documentation on futures, options, and futures-options contracts can be found here:
http://www.zorro-trader.com/manual/en/contract.htm
Posted By: jmlocatelli

Re: How to trade a different asset than that used for training? - 04/12/18 15:13

tks for the info.
The broker already provides me the continuous contract futures series.
Its associated asset name is "WDO$D".
The asset name for the current negotiated contract is "WDOK18".
I just need to train using WDO$D and trade using WDOK18.
I want to keep things simple.

I can change the script manually removing the optimize commands, assign the optimized values to the parameters, and change the asset name. But its a little more complicated when using machine learning.
Posted By: AndrewAMD

Re: How to trade a different asset than that used for training? - 04/12/18 15:28

Who's your broker, and which plugin are you using?
Posted By: jmlocatelli

Re: How to trade a different asset than that used for training? - 04/12/18 15:37

I trade Brazilian market. The broker's name is XP.
I use Metatrader 5 with MT4/5 plugin.
Posted By: kujo

Re: How to trade a different asset than that used for training? - 04/12/18 15:40

Originally Posted By: AndrewAMD
You can construct a continuous futures series using contract data.

Documentation on futures, options, and futures-options contracts can be found here:
http://www.zorro-trader.com/manual/en/contract.htm



As far as I know (according to Support), Zorro doesn't provide any out-of-the box functionality to construct a continuous futures contract. My idea was to construct it manually using Zorro's datasets. If you know a better way, could you please share your thoughts?
Posted By: AndrewAMD

Re: How to trade a different asset than that used for training? - 04/12/18 16:09

Originally Posted By: kujo
My idea was to construct it manually using Zorro's datasets.
Manually is exactly what I meant.
Posted By: jmlocatelli

Re: How to trade a different asset than that used for training? - 04/12/18 18:37

for the pourpose to train on asset WDO$D and trade on asset WDOK18, would does this work??

asset("WDO$D");
vars PriceCloseWDO = series(priceClose());
Parameter = optimize(...);
var Signals[2];
Signals0 = signal generation based on Parameter and PriceCloseWDO ...
Signals1 = signal generation based on Parameter and PriceCloseWDO ...
bool BuySig = adviseLong(DTREE,0,Signals,2) > 0;
bool SellSig = adviseShort(DTREE,0,Signals,2) > 0;

if(is(TRADEMODE)) asset("WDOK18");
if(BuySig) enterLong();
if(SellSig) exitLong();
Posted By: Fiber

Re: How to trade a different asset than that used for training? - 04/12/18 19:14

Edit asset name in .par file, and change name of .par file. Or copy paste content between .par files.
Same for .c files if using ML.
Posted By: jmlocatelli

Re: How to trade a different asset than that used for training? - 04/12/18 20:28

Thanks fiber,

"I can change the script manually removing the optimize commands, assign the optimized values to the parameters, and change the asset name. But its a little more complicated when using machine learning."

I'm already doing this. It's prone to errors.
But could have a straightforward way.
Posted By: Fiber

Re: How to trade a different asset than that used for training? - 04/14/18 19:34

What if to rename WDO$D history files to WDOK18X and while training use History = "X.t6";

----
History
The last part of the file name - including extension - of the historical data files; for selecting between different sets of price histories for the same asset. If not set up otherwise, the files begin with the asset name and year number, and end with ".t6". Examples: History = "fxcm.t6" reads price history from f.i. EURUSD_2015fxcm.t6; History = ".t1" reads T1 price history from EURUSD_2015.t1. History must be set before calling asset().
Posted By: jmlocatelli

Re: How to trade a different asset than that used for training? - 04/23/18 18:08

Tks Fiber.
It was exactly what I did to "solve" the problem.
© 2024 lite-C Forums