Build 135 full: Large differences in the calculation between SQX, AlogWizard, CFD Live Trading

For me there are big differences in the calculation between SQX, AlogWizard and Live/Demo Trading. I'll make that clear using the example of the S&P500 CFD.


SQX and AlgoWizard calculate the same. My entries are:
Data source Dukascopy
Symbols: USAIDXUSD - M1
Spread = 0.5
lots = 0.1
stop loss = 1
Profit Target = 1


Result in SQX and AlgoWizard:
Stop Loss = -5 USD
Profit Target = $5


Demo trading results (ICMarkets, MT5):
Error message: Alert: The order request could not be completed. Error no.: 4796.
It follows that the stop loss and profit target are set too tightly - see attachment S&P500 1 and S&P500 2.
So in MT5 1 tick does not equal USD 5 as in SQX and AlgoWizard, but USD 0.1


100 tick in MT5 as a ProfitTarget and StopLoss entry in the Expert Advisor correspond to a distance on the MT5 price scale in the amount of USD 1 - see Appendix S&P500 3 and S&P500 4. At 0.1 lot in MT5 -/+ 12 cents and not as in SQX and AlogoWizard +/- USD 5 shown as stop loss and take profit in the result.


As a result, there is a difference between the calculation of SQX and AlgoWizard and S&P500 CFD Trading in MT5. As an attachment of the EA.




What do you suggest to get the right result in all systems?
I ask in the cleaning of the bugs.

Attachments
DIff SQX AlgoWizard MT5.sqx
(3.49 KiB)
SP500 2.jpg
(402.99 KiB)
SP500 1.jpg
(335.43 KiB)
SP500 3.jpg
(170.22 KiB)
SP500 4.jpg
(236.35 KiB)
mt5 test 01L 1pip only Tp SL.mq5
(233.06 KiB)
mt5 test 01L 1pip only Tp SL.ex5
(134.58 KiB)
  • Votes +1
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

Dw
#1

Diwi

26.10.2022 20:02

Task created

Dw
#2

Diwi

26.10.2022 21:56
Symbol is Symbols: US500AIDXUSD - M1 (S&P500 CFD)
E
#3

Emmanuel

28.10.2022 12:59
Voted for this task.
Dw
#4

Diwi

30.10.2022 09:49

Attachment Broker dependet data.jpg added

Broker dependet data.jpg
(103.23 KiB)

Hello Improver,


Addendum to the above problem: In the futures area, the above conversion problem does not exist. In the CFD area, different brokers have different tick sizes for the stock indices. In the problem described above, the minimum tick size at this broker is USD 0.10. The minimum volume step is 0.1 lots. The next minimum price change possible is equal to USD 0.1 (10 ticks per USD1) with two decimal places.


Other brokers only have one decimal place after the comma, this is to be considered in a solution!


It would be nice to be able to enter a conversion factor into the MT4, MT5 and Tradestation engine so that the result (for example: stop-loss ticks or USD would be displayed in SQX Builder and SQX AlgoWizard) can be corrected manually if the SQX calculation is incorrect can. An ideal place to do this would be Builder/Full setting/Data. For example, the user could enter Heri: 1 tick corresponds to USD 1.2 to the base unit 1 lot.


The problem is as old as SQX.

g
#5

Lee Guan Chuan

02.12.2022 09:05

Status changed from New to Waiting for information

Hi Diwi,


First of all, I hoped I interpreted the message correctly.


First, the MT5 has different results compared to SQX. It was because the symbol has different attributes.

  1. You have to go to Data Manager first. 
  2. Then in Data Manager, you double-click the symbol that you are using. 
  3. There will be a pop-up show for you, in the second section, there is a selected instrument. 
  4. So, once you get the instrument name, please close the pop-up.
  5. Go to the instrument tab and find the instrument based on the instrument name you get in steps (3 or 4), double click the instrument.
  6. Over here, you need to modify the attributes according to the ones you get in MT5.

You also can look at this script on our Discord server.
https://discord.com/channels/426766614734831616/787036463861727293

Unfortunately, it doesn't support CFD at the moment. However, it will work for other instruments if needed.


Second, different brokers will have a different minimum distance for pending orders, SL or TP. If we set it too close to the current price, we will get an error from the broker. You can set this when you run the backtest in SQX.

  1. Go to "Full settings"
  2. Under the "Test parameters" section, there is a "Min. distance" input. 
  3. Please set the distance over here.

I hope I explained the issues correctly.


Thanks.

Dw
#6

Diwi

02.12.2022 13:35
Thanks for now.

I will check it in build 136.

g
#7

Lee Guan Chuan

04.12.2022 02:15

Status changed from Waiting for information to Fixed


Votes: +1

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please