Oanda MT4-Bridge V20-API history and hedging

Posted By: laz

Oanda MT4-Bridge V20-API history and hedging - 08/05/19 17:04

Hi guys, after I have trained/tested only with the *.t6 data from the Zorro download page I want to test my system now on a demo account. To TRAIN, TEST and TRADE on the same data I decided to go with Oanda, because they offer a lot of historical data. I have created a new, empty history folder under Zorro-History-Oanda and changed the entry in ZorroFix.ini.

As far as I understand, you can connect Zorro with Oanda in 2 ways:
MTR4-Bridge or V20-API
Quote
BarPeriod = 60;
LookBack = 220;
Now, when I try to download historical data through the MTR4-Bridge, only a few records (4881 M1 data records / 60 = 81.35 hours) are downloaded.

The little data available on the MTR4-Bridge is explained here: https://zorro-project.com/manual/en/mt4plugin.htm
Quote
Some MTR4/5 servers have no sufficient price history for systems with a long lookback period, such as Z1, Z2, or Z12 - especially when starting after a holiday. The strategy will then not start, and a Error 047 message is displayed. In that case use the PRELOAD flag or the Preload .ini setup for using Zorro's own history instead of the Meta Trader server.

Ok, so for now i have used the V20-API to download the last 5 years of historical M1 data. My system uses Hedging (Zorro Free), so I created a V20-MT4-HEDGING subaccount at OANDA. Since I need hedging - I wanted to trade over the MTR4-Bridge for now.

Now I have the following questions:

1. PRELOAD not set : Which price data does Zorro load after clicking on "TRADE" on a connection via MTR4-Bridge and where from? Oanda data from OANDA-MT4-SERVER, from MT4 *.hst files or Metaquotes? Does it make sense to collect M1 data in *.hst files to get more history for Zorro?

2. PRELOAD not set : Zorro downloads the price data from the Broker/Api/Bridge. If there is not enough M1 data, Zorro uses higher timeframes? If Zorro is connected via MTR4-Bridge, Zorro downloads M15 data (instead 1 Minute) after clicking on "TRADE", does that happen because too little M1 data is available? Why 15 Minutes? How does Zorro handle the situation if the gap is bigger then the amount of M1 data?

3. Is it somehow possible to use only the V20 API and hedging with Zorro Free?

4. "The Oanda V20 API does not return rollover rates, so swap and commission must be located on the Oanda website and manually entered in the asset list." Does the MTR4-Bridge return correct rollover rates?

5. In some examples (A,B) you can see that they download/refresh historical data (via assetHistory()) in the script, in some they do not (C). When do you have to use assetHistory(), when not?

6. I would now proceed as follows: I would update all data through the V20-API until today. Then I would do the trading via the MTR4-Bridge (to be able to hedge), set PRELOAD and use assetHistory to store the newest data. Is that correct?
Posted By: SteveG

Re: Oanda MT4-Bridge V20-API history and hedging - 06/02/20 00:40

I know this is an old post. Was there ever an answer to the OP questions?

Once you have data in the files, how is it updated / appended with real time data?

I just opened an Oanda account today.

Thanks
Posted By: jcl

Re: Oanda MT4-Bridge V20-API history and hedging - 06/02/20 09:42

When you connect to the Oanda API, you get historical data from the Oanda API. When you connect to MT4, you get historical data from MT4.

When PRELOAD is set, you get historical data from your previously loaded history. If that data is not sufficient to fill the lookback period, you get the remaining data from your connected broker.

https://manual.zorro-project.com/mode.htm
Posted By: SteveG

Re: Oanda MT4-Bridge V20-API history and hedging - 06/03/20 22:40

Thank you ... I will keep reading
© 2024 lite-C Forums