Hi there, i have an issue with OrderClose() command generating error code 138 This seems to work OK, that is: No 138 errors void OnTick () { if ( iTime (symb,timecheck, 0
Hi all, if you have the following program extern int var = 0 ; OnInit() { } OnTick() { if ( var == 1 ) { < do something>; var = 0 ; } } If during operation
My broker uses EURUSD. (note the ".") as opposed to simply EURUSD Does that mean that my trading system can not be offered as an MT4 Signal? (ie. i'd be a signal provider ) and vice-versa, i can never follow a signal from someone how trades EURUSD
If i have an EA monitoring my account and able to close all my positions like: OnTimer () //a 1 second timer { If(AccountEquity()>target){ Close all positions with certain MagicNumber}} And at the same time have many EAs on as many
In one of my EAs i'm calculating how long a trade is open (in seconds) I used it to test if order were open for longer than a week. In such case the inclusion of a weekend was no factor. As i'm now thinking of testing for shorter periods - 2 or 3
In my EA I have a simple trigger to send an email something like this: bool email_sent; [....] void OnTimer () { if ([no positions]) email_sent= 0 ; if ([positions open] && [some indicator > some value] &&
Something is off... I've tested my EA before successfully, but now it does not work. The value for the CCI is always "0". cci_long= iCCI ( ChartSymbol (),cci_timeframe[pos],cci_bars, 6 , 0 ); Print ( " CCI_long = "
I have a weird one below: The if statement should only be able to return 'true' on Fridays , yet i have this trigger every day for some odd reason and positions close as a result. void OnTick () { <snip> if (TimeHour( TimeLocal
Yesterday's upgrade to Win10 Pro version 1511 OSbuild 10586.17 seems to have wrecked the compiler! (I have MetaEditor 5.0.0.1218 ) Cannot compile anything and continue to get "EX4 write error". Starting Editor in compatibility mode doesn't help
Having problems with customer set inputs. i read: https://docs.mql4.com/basis/variables/inputvariables but i cannot get it to work. this is what i want to do: simply create long/short as part of drop down box during input... #property strict
I have my EA protected for a crash by means of a file (crash.bin). While running the EA it writes the crash.bin file every 30s, and it holds important data for when having to recover. If the EA is removed on purpose then the crash.bin file is deleted
i have the following simple code for an OnTimer() function: void OnTimer () { int bla= FileOpen ( "last.txt" , FILE_READ | FILE_CSV , " " ); if (bla== INVALID_HANDLE )
Hello i'm looking to run a BAT file from a script (and upon successful testing ultimately from an EA). I've looked at https://www.mql5.com/en/forum/139191 which i found very helpful but... #property strict #import "shell32.dll" int
Say i have a file: "DOWJONES.txt" the file is updated from time to time through email scripts whenever the file is updated, it needs to be read by an EA and the new values must be loaded. FileGetInteger() can tell me if a new file is present by
Someone asked me an interesting question: Is it possible to Hide Outside Trading hours? So if you show DAX, that only bars during Frankfurt trading hours are shown and rest of data is discarded - that is: price is moving , but no bars are formed. I
I'm using the 'while' statement with great success for some recovery work. Embedded is a counter (for # of tries) and after such # of tries there are checks/balances before looping back to the counter such to ensure things don't take too long and
I have use FileWriteArray() succesfully in multiple EAs, but this time it just writes "0"s - or it doesn't write at all, despite the msg: File Write =OK. As i'm using the exact syntax i used in other EAs i'm really puzzled and after a couple of
I throw a lot of info on the chart in my EAs and would like to organize that a little better. To separate values I now go about it as follows: string text; text= StringConcatenate ( "tic= " ,tic, " tac= " ,tac
I could be overlooking this, but is there a setting in MT4 that gives the user a "are you sure?" question before closing MT4? Using RDP, I've closed MT4 a couple of times when I meant to close RDP. Yes, lot's of cursing... thanks