Cannot configure MaxSlippage, for 5-digit brokers

1. I don't see anywhere to set sqMaxEntrySlippage. This is currently hardcoded at 5

2. For 5-digit brokers, it should be 50, not 5.  May be, a code like this?


if (Point == 0.00001 || Point == 0.001) { sqMaxEntrySlippage *= 10; StopLoss *= 10; TakeProfit *= 10; // And so on }


Attachments
No attachments
  • Votes +1
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

m
#1

murty

20.08.2019 07:59

Task created

m
#2

murty

20.08.2019 08:00
Voted for this task.
m
#3

murty

20.08.2019 08:00

Subject changed from Cannot configure MaxSlippage to Cannot configure MaxSlippage, for 5-digit brokers

h
#4

hankeys

20.08.2019 13:36
you need to edit it in the MQL code or in the template, because its not an EXTERN


i have made changes in the template, so i have right in the MQL code ZERO slippage


but i think, its already set up in pips, not sure...


//+------------------------------------------------------------------+

// -- SQ internal variables

// add word "extern" in front of the variable you want

// to make configurable

//+------------------------------------------------------------------+

int sqMaxEntrySlippage = 0;          //zero means unlimited slippage

int sqMaxCloseSlippage = 0;          //zero means unlimited slippage

m
#5

murty

20.08.2019 17:31

These are declared as int, assigned value in pips but OrderSend expects in Points.  For 4-digit brokers, value in pips == value in Points. But for 5-digit brokers, Point is 0.1 pip

TB
#6

Tomas Brynda

22.08.2019 09:37

Status changed from New to Fixed

I added automatic slippage correction into MQL code. It will auto correct slippage for symbols with 3 and 5 digits - it will multiply slippage by 10 as you suggested.


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)  


This behaviour could be turned off by setting autoCorrectMaxSlippage = false.


If you want to be able to alter max slippage settings right in EA parameters, just add the word "extern" before the variable declaration (or "input" if you are using MT5).



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