Another soft spot of MT4/MQL4 ???

 

My previous posting titled "Multiple instances of EA" hasn't got an effective solution, Here comes another one...

After attaching an EA to a chart, the EA will initialize itself every time you switch intervals (for example, M15->M1). By "Initialize", I mean it resets global and static variables and calls init() again. EA should NOT respond to interval switch made by user. It should not be distracted by changes in chart display setting and should only keep close watch of market fluctuation and make responses (buy, sell, or modify existing orders, etc) accordingly.

Any comments? Do MT5/MQL5 have similar issues?

 
linx:

My previous posting titled "Multiple instances of EA" hasn't got an effective solution, Here comes another one...

After attaching an EA to a chart, the EA will initialize itself every time you switch intervals (for example, M15->M1). By "Initialize", I mean it resets global and static variables and calls init() again. EA should NOT respond to interval switch made by user. It should not be distracted by changes in chart display setting and should only keep close watch of market fluctuation and make responses (buy, sell, or modify existing orders, etc) accordingly.

Any comments? Do MT5/MQL5 have similar issues?


Any comments? Do MT5/MQL5 have similar issues? Why not ask the Mql5 forum? Or better yet, help yourself and go through the mql4 & mql5 docs. You may think it shouldn't but other people think it should (metaquotes corp for example). Sorry if this comes across blunt.

Oh. BTW I taught BarrorBoy give very good response to your previous post "Multiple instances of EA" hence no need for me to respond. Thats how I felt about that topic. Free software, free forum, none of us here gets paid :)

 

Don't get angry, man! I didn't blame anybody in this forum. As you said, no one is paid for answering questions. However, the point we have such a forum is to help one another by Q/A. If you don't feel confortable, you can either ignore my posting or get out of here.

I have said "thanks" to BarrorBoy. However, I have to point out my question about accessing common data has been not properly addressed. Again, no one is obliged to give a solution. If you don't feel confortable or you don't know the answer, just be QUIET!

Does everyone have to read all mql4/5 docs and books before posting on this forum?! Do you?

 
linx:

It should not be distracted by changes in chart display setting and should only keep close watch of market fluctuation and make responses (buy, sell, or modify existing orders, etc) accordingly.

It shouldn't be 6C outside but it is . . .

If you have your EA on a GBPUSD chart and want to look at GBPUSD on a different timeframe open another GBPUSD chart and select the timeframe you want to look at.

 
RaptorUK:

It shouldn't be 6C outside but it is . . .

If you have your EA on a GBPUSD chart and want to look at GBPUSD on a different timeframe open another GBPUSD chart and select the timeframe you want to look at.


Sorry guys for losing my temper, I didn't realize I actually hit someone's soft spot until ...

Thanks for the workaround. I have to change my claim about "Initialize". It doesn't initialize static variables, so I can prevent init() from being called twice by inserting three lines of code at the very beginning of init()

int init()
{
    static int flag = 0;

    if (flag>0) return(0) // bypass the rest 
    flag = 1;

    .......
 
linx:


Sorry guys for losing my temper, I didn't realize I actually hit someone's soft spot until ...

It's all good. I'd like to think I have liquid-nitrogen running through my veins by now. I mean going through blackjack and trading... so things like these don't move me easily. Like I said, I didn't mean to offend, but someone had to set my expectation for this forum at some point.

I've seen your profile and you have very extensive programming experience. I welcome you to the forum.

Reason: