Giter VIP home page Giter VIP logo

mt4-mql's People

Contributors

andvy avatar rosasurfer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mt4-mql's Issues

Tester & demo servers may not execute specified stoplosses

Checking and execution of stoplosses in Strategy Tester and on demo servers is broken. In a fast market both limits of a pending entry order with attached stoploss may be triggered by the same tick. Tester and demo servers only check a single order limit per ticket and tick. As a result such an entry order is reported as open (filled) while in a real market it would be closed. The stoploss limit will be checked at the next tick but if the next tick doesn't trigger that limit the order will stay open and the position becomes invalid. In a real market such an order would be closed. In tester and on demo servers it may stay open for an infinite time.

Imagine a market at 1.2000, a Buy Limit order at 1.1998 with a SL at 1.1995. Further assume an open long position with SL at 1.1990. If the market spikes down to 1.1990 with a single tick (e.g. news) all existing limits are triggered (the buy limit and the two stoplosses). Despite the market now being at 1.1990 tester and demo servers will report the Buy Limit order at 1.1998 as open and the SL at 1.1995 as not executed.

If the next tick is above 1.1995 (the SL of the wrongly reported open order) the SL is not triggered and the order is not reported as closed again. If the market continues to go up the SL may never be triggered and the order stays open, while in a real market the order would be immediately closed. Tester and demo server will be in an illegal state.

The workaround is to manually check the exit limit of orders with entry and exit limits on the tick the entry limit is reported as executed, and to manually execute such ignored exit limit.

error

hi, thanks for your sharing.
I'm having this problem and can't fix it.
Maybe I have a different version.
how can i fix it?
I have read the file in bin ( README )
but I don't understand if and how to fix it
Thanks again

image

In MQL libraries global string variables are released too early

When a MQL library's deinit() function is called previously defined global string variables are already destroyed and reset to a non-initialized state. The bug always occurres with indicators in regular charts (during their init cycle) and with indicators and experts in the Strategy Tester. The bug was not observed with scripts. All tested terminals from build 225 to build 1090 behave the same.

How to reproduce:
string foo;

/**
 *
 */
int init() {
   foo = "bar";
   Print("init()    foo: \""+ foo +"\"");
   
   int error = GetLastError();
   if (error != ERR_NO_ERROR) Print("error: "+ ErrorDescription(error));
   return(error);
}

/**
 *
 */
int deinit() {
   Print("deinit()  foo: \""+ foo +"\"");
   
   int error = GetLastError();
   if (error != ERR_NO_ERROR) Print("error: "+ ErrorDescription(error));
   return(error);
}
Expected result:
init()    foo: "bar"
deinit()  foo: "bar"
Actual result:
init()    foo: "bar"
deinit()  foo: ""
error: ERR_NOT_INITIALIZED_STRING
Solution:

none

Workaround:

If string variables are needed in deinit() the values have to be stored elsewhere, e.g. in astring[] array.

Compilation issues

Hi, I found your EA and wanted to try it. did all download but find that the Metatrader editor cannot compile. Maybe there is a manual or installation guide available that I could not find yet?
I´m definitly a biginnner with this tool. Kindly allow my questions.
The sizes.mqh is creating probelms during compilation. Compile "complaints" are about the "." for all definitions.
#define FXT_HEADER.size
Simiplar complaints in stddefines.mqh with e.g.
#define Math.E (again the "." make the trouble)

all in all I get 3005 errors and 712 warnings. for sure stupid me!

any help will be appreciated.
thanks

Builds 1065 and newer: Illegal call of Expert::init() before input dialog is closed

After opening the "Load expert" dialog the terminal sometimes executes Expert::init() before the OK button is clicked. This can happen immediately or later (as long as the dialog is not closed). If it happens the expert is initialized with the default parameters, already loaded presets from a presets file are not applied. Further the usual log statement showing the applied parameters will not appear.

After the dialog is closed by clicking the OK button the real input parameters are logged and Expert::init() is called a second time. So, if this error occures the terminal log shows two log statements ExpertName Symbol,Period: initialized, and only one log statement with the applied input parameters.

Related function return values in the first init() call indicate no irregularities, i.e.:

UninitializeReason()           // the regular value for the second init() call
WindowOnDropped()  =  0 | -1   // both values have been observed
WindowXOnDropped() = -1
WindowYOnDropped() = -1

bug terminal b1065 ea--init

Can i use python to create EA for MT4?

I want to create mt5 bot because mt5 is intergrated with python but the problem is that my broker doesn't have option to copy trade from mt5! So please is they any how i can create EA for mt4 using python?

Cannot compile mt4-mql mq4 files.

Hi,

Best wishes for the new year.

I came through your mt4 project and I think you so much for sharing. I am interested in testing the indicators and EAs. However, and as already stated by another user, I am not able to compile the indicators and EAs even with an old mt4 editor.

Also, I tried many times to get the binaries (ex4) from the release folder you provided, but it is always empty.

Would it be possible to get the binaries (ex4 files) so I can test them.

Thank you in advance and have a great day.

Kind regards.

OrderCloseByEx() returnes wrong openTime/openPrice/lots for partial close

How to reproduce:

int oe[];
int longTicket  = OrderSendEx("EURUSD", OP_BUY, 1.4, NULL, NULL, NULL, NULL, NULL, NULL, NULL, Blue, NULL, oe);
int shortTicket = OrderSendEx("EURUSD", OP_SELL, 0.2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, Red, NULL, oe);
bool status = OrderCloseByEx(longTicket, shortTicket, Orange, NULL, oe);
ORDER_EXECUTION.toStr(oe, true);

Expected result:
The struct should contain the execution data of the closed partial position, i.e. original open time and price, closing time and price, and the amount of closed lots.

Actual result:

ORDER_EXECUTION.toStr()  {
   error=0,
   symbol="EURUSD", digits=5, stopDistance=0, freezeDistance=0,
   bid=1.2018'3, ask=1.2018'4,
   ticket=1, type=OP_BUY, lots=1.4,
   openTime=0, openPrice=0.0000'0,
   stopLoss=0.0000'0, takeProfit=0.0000'0,
   closeTime='2017.09.20 12:48:05', closePrice=1.2018'3,
   swap=0.00, commission=-0.86, profit=-26.63,
   duration=0, requotes=0, slippage=0.0, comment="",
   remainingTicket=3, remainingLots=1.2
}

Note that openTime and openPrice are empty and lots contains the full lots of the ticket passed in the first parameter.

source code for dlls

Hello

This looks like a really excellent project! Nice work!

Is the source code for the dlls also open source?

Thanks and regards

Errors compiling MT4 indicators

Hi,
I'm trying to load MT4 indicators (for example HalfTrend.mq4).
Getting compilation errors, for example:

'.' - unexpected in macro definition sizes.mqh 42 11

'.' - unexpected in macro definition stddefines.mqh 67 13

'@' - unknown symbol HalfTrend.mq4 265 7

'.' - semicolon expected stddefines.mqh 20 22

'.' - semicolon expected HalfTrend.mq4 20 20

image

I have downloaded the source code today (28NOV21) and placed /mql4 files in my DataFolder.
Using the latest versions of MT4 and MetaEditor:
image
image

Did I miss any step in the installation?

SyncMainContext_init() DLL exception

Hello, using the latest release im trying to test out the snowroller EA. I get the following error when I try to run it in the tester:

ERROR: EURUSD,M15 SnowRoller::init(2)->SyncMainContext_init() [ERR_DLL_EXCEPTION]

I think it might be an access violation. The experts tab shows this:

2021.04.24 20:32:56.409 2018.01.02 00:00:08 SnowRoller EURUSD,M15: function 'SyncMainContext_init' call from dll 'rsfExpander.dll' critical error c0000005 at 6222B9F0.

I'm running mt4 build 1280.

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.