Forum

how to retain variable if mt4 needs to restart?

Hi all, What are the methods to retain a variable value if mt4 was restarted? i can only think of either 1. storing the information in the comment of an order 2. save the info in a csv file and read it back later Thanks

Question regarding trendline in EA

Hi all, I read somewhere we can draw trendline in indicator but the information is still very vague for me Need help to clarify a few things 1. I assume it is true you can draw trendline with mql4. do we use obj_trend for this? 2. is it possible to write an EA whereby once the trendline is

how to read the whole string of csv file?

Hi all, I have a csv file with 2 variable, equity and time stamp as shown below 10494,2016.05.06 23:55 When i try to read the content of the csv file using the script below, it gave me only the equity (10494) which is the "text" variable How do i read the whole string which is 10494,2016.05.06

is there a variable that is tied to the account number?

Hi all, let's say the value 100 in a variable and that variable is tied to the account number . is that possible? the reason why i want to do that is because if my mt4 crashed and i need to restart my ea, all the variable value are gone so if i can somehow store this value that is tied to my account

daylight saving time function TimeDaylightSavings();

int TimeDaylightSavings (); can anyone tell me if this function is accurate in the sense it really follows the actual date when dayight saving is active or not

itime question

hi all, for iTime(NULL,0,0), this is the time of the candle open right? like 5m chart will be 19:00 19:05, etc

iclose and ontick

hi all, i am a bit confused here if i use ontick, 1) is iClose (NULL,NULL,0) the closing price at the end of current bar or tick price? 2) is Close[0] the tick price? Thanks

possible to identify the currency in a pair?

hi all, i want to do a currency strength type of EA So, let's say i want to long EU I want to see if euro part of the pair is in also long in EJ, EG so is it possible to automatically identify Eur in the EU on my chart and then find the euro direction from EJ, EG ? hope you understand my question

possible to append 2 different comments?

hi all, if i have 1 comment command at the top of the codes and at the bottom i have another comment command is it possible for the 2nd comment to be appended to the 1st one? currently i notice it will only show the 2nd (i guess the 2nd overwrite the 1st) thanks