Reply

Strategy Quant to MT4 – No Trades

5 replies

Matthew Finch

Subscriber, bbp_participant, 0 replies.

Visit profile

4 years ago #248279

Hi,

I’d be grateful for a steer in the right direction, please. I used my trial SQ license to create some nice EURUSD strategies and have these in various portfolio combinations. They have been forward tested to death using Monte Carlo and other robustness but I still have to do some testing in MT4. Here there is an issue.

1. My strats are all using money management of 1% so if I have an account balance of £100, then each trade should be worth £1. With leverage of 1:20, that’s a trade of £20 and the margin requirements are 5% so the whole balance needed is £25. When I test this combination, no trades are produced in MT4. I get buys and sells of stops, then they are deleted. Journal reports that there is not enough money in the account but then reports a positive balance and a margin amount, none of which change.

2. I know it’s not a margin issue since I can then place a manual trade for approx £20 value and this goes through immediately.

3. As a final test, I did the same test as 1. but used an account balance of £1 million and trades were created.

I thought that perhaps the strategies had been miscoded somehow, namely I didnt used the right MM, but I checked the code and it is 1% MM.

I used the same data to create the SQ strats and MT4 so that’s not the issue. I expected to get up to 4 strategies on £100 account balance (more or less) but I am now totally stuck if I can’t get results on one. Additionally, when I created strategies previously with Forex Strategy Builder (sorry…) I had the exact same issue but I now need to get to the bottom of it.

I wanted to attach an example strategy but for some reason I cant to this thread.

Thank you,

Matthew

0

Matthew Finch

Subscriber, bbp_participant, 0 replies.

Visit profile

4 years ago #248281

There we go 🙂

Attachments:
You must be logged in to view attached files.

0

hankeys

Customer, bbp_participant, community, sq-ultimate, 487 replies.

Visit profile

4 years ago #248286

i spent some of my time to look at your strategy and it doesnt make sense to me

– why do you have set slippage and spread as 10 for EURUSD?

– why do you use some kind of data from 1971? where did you get it? did you test it with tick precision on dukascopy and make appropriate UTC change? Daily strategies will be affected due to time of candles.

– why do you want to use % MM and have set decimal to 1? What do you want to achieve with this MM?

– do you really want to trade D1 strategy which make 1 trade for a quarter of year and for the last 2 years have only losses? do you know what are swaps?

 

You want to be a profitable algotrader? We started using StrateQuant software in early 2014. For now we have a very big knowhow for building EAs for every possible types of markets. We share this knowhow, apps, tools and also all final strategies with real traders. If you want to join us, fill in the FORM.

0

Matthew Finch

Subscriber, bbp_participant, 0 replies.

Visit profile

4 years ago #248305

Hi – thanks Hankeys,

I really appreciate your feedback on that. Alot of my algo development has been guesswork and trial and error (evidenced by the number of requests on the forum, no doubt) so this really helps me to get closer to my goal. To answer your questions –

1. Slippage at 10 – this was a guess just to enter a number, but that seems quite high, I admit. I was looking at worse case scenario. I saw some stats that said “most” brokers will have less than 1.0 slippage but I saw one which had 5 or even 7 points per trade. Therefore, my thinking was if a strategy can make money on a high slippage, it can make money in a normal execution.

2. Spread at 10 – same logic for worse case scenario. EURUSD for my broker is currently 1.2 and historically this has gone up to 5.0 in volatile markets. Again, if a spread of 10 makes money, the results would be even better assuming a spread within normal ranges.

3. Data from 1971 was exported from MT4 and I imported this into SQ. I also tested the strats on Dukascopy data with a smaller timeframe and kept only those strats which performed well on them both. I didnt make the time zone change but that’s something I will ensure to look out for as well, thanks for the tip.  They were tested on faster timeframe for tick data only at this point, too, since I was running out of time on my trial period after extending it many times. I had to draw a line and just go with my strats I was most comfortable with.

4. Not many trades, I know. Two reasons why this was OK for me – 1) I am just testing putting completed strategies into a demo account at this stage and 2) I have 76 strategies in total which have all passed decent robustness testing and I would be using these as a portfolio in combination. Using Quant Analyser for the top 5 strats, for example, brings any average of 28 trades per year (i.e. 2 a month in total) since the start of testing so that would be OK for me at this point.

5) When you ask – why do you want to use % MM and have set decimal to 1 … I just want to trade 1% currently of my account balance. The user guide suggested this and I wanted to limit my losses and max out my long term growth. But – set decimal to 1 – I am not sure. I just copied across the strat as it came out of SQ, Im pretty sure. Does something look wrong there?

Ultimately, with these strats, I am looking to just to see trades running on an MT4 backtest and the variables (spread/slippage/MM) I can change later on, so I am not too worried about those in the test phase, assuming they are not the reason why there are no trades created. Tweaking is fine but no trades is worrying when I dont understand why.

As I said, nothing is produced for 1,000 GBP at all. The margin requirement (Oanda) for EURUSD is 5%. I am assuming that the 1% mentioned in the MM% is the account balance before leverage is applied, i.e. the first trade would be equivalent for £50 – plus the 5% = £52.50. Loads of margin there. But when I put £1 million on there, the trades work.

Would you suggest any changes to code (which I could do manually to the others ) to make these strats at least create something? If so, would you be able to please indicate where I would make those changes, either in the file itself or on the EA properties.

And not entirely sure about the swaps, I just wanted to work out the normal FX first.

Thank you so much,

Mathew

 

 

 

 

0

hankeys

Customer, bbp_participant, community, sq-ultimate, 487 replies.

Visit profile

4 years ago #248314

my advices for you:

– for EURUSD use spred 2, slippage 1 – this is enough for the real accounts – average slippage is something like 0.5 pips. How did you see the slippage in brokers – no broker will tell you the slippage, it is happening for STOP and MARKET orders and you need to compute it from logfiles

– start with fixedlot MM

– i dont like D1 strats

– swaps are not trading instruments in forex, but costs for holding positions and they are mostly negative for your side 🙂

– always use dukascopy data, 1M precision is enough and clone them to your broker time

this is only the basics…

You want to be a profitable algotrader? We started using StrateQuant software in early 2014. For now we have a very big knowhow for building EAs for every possible types of markets. We share this knowhow, apps, tools and also all final strategies with real traders. If you want to join us, fill in the FORM.

0

Matthew Finch

Subscriber, bbp_participant, 0 replies.

Visit profile

4 years ago #248356

Thanks, Hankeys – sorry for the late reply, I just moved internationally and have been offline a few days.

I appreciate your advice in the previous message. I really want to stick with the strategy I have at the moment since I want to see trades being created with a strategy created in SQ first. But I eventually want to have multiple strategies so am keen to try yours as well.

I fundamentally still do not understand how a strategy which creates trades in SQ does not create trades in MT4 with the same data and with different results on the capital amount, though. Perhaps this is as simple as the time zone but since I no longer have the SQ trial version, I am going to need to deal with the code directly or any configurable variables in MT4. But if this was just a timezone issue, then that doesnt explain why I get trades on a balance of 1 million but not on 100.

But I can try what you suggested :

“for EURUSD use spread 2, slippage 1”

In the code for one of the EAs I created, I checked the code and I see a reference to slippage

//+————————— —————————— ———+
// — SQ internal variables
// add word “extern” in front of the variable you want
// to make configurable
//+————————— —————————— ———+
int sqMaxEntrySlippage = 5;          //Max tolerated entry slippage in pips. Zero means unlimited slippage
int sqMaxCloseSlippage = 0;          //Max tolerated close slippage in pips. Zero means unlimited slippage      
bool autoCorrectMaxSlippage = true;  //If set to true, it will automatically adjust max slippage according to symbol digits (*10 for 3 and 5 digit symbols)  

It is not clear to me (as a non programmer) where/if I need to add “extern” and whether I need to change entry and/or close or whether I just need to change the value for EntrySlippage from 5 to 1 …

Also, I do not see any reference in the code to change the spread.

Neither do these options come up in the configurable variables in MT4 so I am still quite stuck.

And do you think that changing these will give trades on a balance of 100 GBP in the account, otherwise its just playing around with a strategy that still doesnt create trades.

Thanks,

Matthew

0

Viewing 5 replies - 1 through 5 (of 5 total)