Sie sind auf Seite 1von 8

InputResizer: edit EA/Indicator settings comfortably @ Forex Factory

Page 1 of 8

Login

2:49pm

Google Search

Forums

Calendar

News

Market

Trades

Shortcuts Subscribed Threads Private Messages Active Threads Member List Online Now

Forums > Platform Tech

InputResizer: edit EA/Indicator settings comfortably


Page 1 of 5 1 2 3 4 5 > Search This Thread Jun 15, 2011 3:06pm Bookmark Thread Tools #1 Member Since Jun 2011 414 Posts

18

Preferred Broker

MaryJane
Consolidating myself

InputResizer: edit EA/Indicator settings comfortably

A foreword to visitors with coding ideas: I'm not a coder, i'm just a do-it-yourself junkie and my primary interest is trading. Generally, i will not code anything per request and especially i'm not coding for money (any amount). However, if you got any interesting (ie. revolutionary, never seen before, totally amazing) idea, you can post details in this thread. I will reply to every post and if i find your idea useful for a plenty of other traders, chances are we get it done and post a mq4 for anyone's use. If you need custom coding of your own project or something that only makes sense to you or a few people or anything that can't go public, try posting a request thread in Platform Tech or - better - pay a coder (for recommendation see coders on my vouch list), but please don't post your request here. Spammers, trolls and beggars will be banned without further notice. Thanks for keeping this thread helpful! ------------------------------------------------Hi everybody I'm starting this thread for a small utility I made upon request in this thread to be able to post fixes/updates in one place, if anybody finds it useful. InputResizer is a workaround for one of many MT4 annoyances. Today's EAs are overloaded with settings. Blessing 3 has 118 lines of input, The Beast has 155. Some more advanced pivot indicators have dozens of them. Yet all our beloved MT4 offers is a tiny, non-resizable dialog box with a 8.5 line peephole. Majority of traders won't mind it, they set their settings once for ever and forget. But if you are one of them who test, optimize, evaluate or just play around with different settings on daily basis, perhaps you know how annoying the game with the micro-scrollbar really is. InputResizer is a set-and-forget utility. Once you set it up, you've done with it. Attach it to one single chart and all those peephole windows you open, in all MT4 instances on your PC/VPS, become resizable. There are two variants - indicator and EA, both doing the same thing. The advantage of using EA is clear; it runs in loop mode and doesn't depend on ticks. The indy does, so if you choose it for whatever reason, you will have to wait for a tick until the indy spots the window you have opened and manages it, so it's good to attach it to a chart (pair) that receives ticks frequently - EURJPY and GBPJPY are good choices. The EA runs 24/7 and checks for windows every 300 msec so you will never have to wait. However, if you start your MT4 when the market is closed, you have to switch on the WeekendMode (see below). There's one little disadvantage in using the EA. I recommend using this variant, but it occupies a chart you can't use for another EA. It's good if you place it on a dedicated chart (M1-W1, pair doesn't matter), minimize this chart and leave it there for good, or at least until I code this thingy as a native Win32 tray icon application (planned soon). This will make both variants obsolete. Note: If you open a window, it won't resize until you select the input tab! Setup (if you use the EA version and want to change its settings while running (F7), switch to Monthly timeframe, change what you need and switch back to any lower TF):

RememberSize, Individual ... ... etc ... initHeight: Per default (set as above), InputResizer will place and resize every input window on its first appearance to coordinates (in pixels) specified. Then, if the input window (distinguished by EA/indicator name) re-appears (on any chart/platform), position/size at last window close will be applied.

http://www.forexfactory.com/showthread.php?t=299017

09/12/2011

InputResizer: edit EA/Indicator settings comfortably @ Forex Factory

Page 2 of 8

If RememberSize = false, all windows will be opened with InitCustom (if true) coordinates, maximized if InitMaximized =true (InitMaximized overrides InitCustom), or at default position with peephole size if both InitCustom and InitMaximized are false. If RememberSize = true, the above is applied only for the first time a window appears. Then, coordinates are stored at each window close and re-applied next time. Stored coordinates override InitCustom and InitMaximized. If Individual = true, coordinates will be stored for every EA/indicator name separately. So your monster EA settings will always appear vertically stretched from top to bottom on the right side but your pivot indy inputs will fit into a 20-line box somewhere in the upper left corner. Obviously this setting is relevant only if RememberSize = true. Note: Coordinates are stored in global variables; they are persistent until you delete them. You can do this anytime by pressing F3 and deleting all global variables starting with 'iRes'. SleepTime: (EA only) time between scans in milliseconds; use a higher number if you're convinced it does eat your resources. Btw: it doesn't. WeekendMode: (EA only) if set to true, no need to use a ticker to get it running. Better set it back to false during normal trading hours to prevent unexpected behavior. Thanks to SteveHopwood for encouragement (Cheers ), Xaphod (his code told me there's something weird called Windows API in this world), and finally to faze for the original request.
Attached Thumbnails

Attached Files InputResizer.mq4 (11.2 KB, 515 views) InputResizerEA.mq4 (11.9 KB, 568 views)

Last edited Nov 22, 2011 12:35am | Reason: foreword to visitors

Jun 15, 2011 4:15pm

#2 Member Since Sep 2006 4,032 Posts

hanover
Commercial Member

Quote:

Originally Posted by MaryJane Hi everybody I'm starting this thread for a small utility I made upon request in this thread to be able to post fixes/updates in one place, if anybody finds it useful. ....... MaryJane, Very nice! Many thanks. The only problem I've found so far is that if you subsequently try to edit an indicator's parameters, it (at least the EA version) locks up MT4. David
Attached Thumbnails

http://www.forexfactory.com/showthread.php?t=299017

09/12/2011

InputResizer: edit EA/Indicator settings comfortably @ Forex Factory

Page 3 of 8

__________________ For a list of indicators and EAs written by hanover, see the foot of this post.

Jun 15, 2011 4:42pm

#3 Member Since Jun 2011 414 Posts

MaryJane
Consolidating myself

Quote:

Originally Posted by hanover The only problem I've found so far is that if you subsequently try to edit an indicator's parameters, it (at least the EA version) locks up MT4. David Strange ... it would help me if I could reproduce the hang-up. I have tried it now with your Recent SR indicator, shuffled params for 5mins, confirmed, reopened, rechanged.. no problem on my W7 box. Will try it on a XP box tomorrow but there should be no difference. If you have the post#1 version (there were clear runtime bugs in the version I initially posted in the former thread), could you please switch the TF w/the EA to monthly and re-try? That puts the EA into tickmode so we would know it's a loopmode problem if it doesn't lockup there.. Thanks for feedback, very appreciated David. I'm sure I will fix this, i hope more ppl will report this so I can get on track with it.
Last edited Jun 15, 2011 5:25pm

Jun 15, 2011 5:58pm

#4 Member Since Apr 2007 8,300 Posts

SteveHopwood
Commercial Member

This is fabulous MJ. Many, many thanks for doing it; InputResizer will become a must-have very quickly. Here is one little wish from me. Is it possible to code automatic full-sizing of an input window as soon as we open it? I am a lazy tyke and the more that happens automatically, the happier I am. Cheers.

__________________ Never trust my programming. I am an idiot.

Jun 15, 2011 6:19pm

#5 Member Since Sep 2006 4,032 Posts

hanover
Commercial Member

Quote:

Originally Posted by MaryJane Strange ... it would help me if I could reproduce the hang-up. I have tried it now with your Recent SR indicator, shuffled params for 5mins, confirmed, reopened, rechanged.. no problem on my W7 box. Will try it on a XP box tomorrow but there should be no difference. If you have the post#1 version (there were

http://www.forexfactory.com/showthread.php?t=299017

09/12/2011

InputResizer: edit EA/Indicator settings comfortably @ Forex Factory

Page 4 of 8

clear runtime bugs in the version I initially posted in the former thread), could you please switch the TF w/the EA to monthly and re-try? That puts the EA into tickmode so we would know it's a loopmode problem if it doesn't lockup... MJ, Tried it on a different br0ker MT4 (Vantage FX Trader MT4 build 392) and seems to work 100%. Strange. I'm running Win XP Home SP2. David __________________ For a list of indicators and EAs written by hanover, see the foot of this post.

Jun 15, 2011 9:11pm

#6 Member Since Aug 2010 30 Posts

Davros
Member Great Work

Thank you Very Much, it was on my Xmas wishlist, (early pressy thank you) __________________ Mission:-Exterminate all Human Labour Result:-All Human Intervention Obsolete Conclusion:-Daleks(Robots) Win!!

Jun 16, 2011 5:40am

#7 Member Since Jun 2011 414 Posts

MaryJane
Consolidating myself updated Quote:

Originally Posted by SteveHopwood Is it possible to code automatic full-sizing of an input window as soon as we open it? Done, update in post #1
Quote:

Glad you like it, really.

Originally Posted by hanover Tried it on a different br0ker MT4 (Vantage FX Trader MT4 build 392) and seems to work 100%. Strange. David, I tested on XP SP3 Pro (GoMarkets) and Win7 Ultimate (GoMarkets, FinFX, Oanda). Except Oanda (build 392) all are 402. Not a slightest glitch. A bit unhappy of this; this kind of bugs is really ugly.. you must know best. I recently browsed the MetaQuotes forum and saw a quote by Rosh (chief developer over there).. he said he goes thru most important forums every day.. sometimes more than once per day... HEY ROSH!! DO YOU SEE IT!! DO SOMETHING!! Hopefully MQ will make the st*pid windows resizable now so we can bin this thread builds every week or so. np as they release new

Jun 16, 2011 6:14am

#8 Member Since Apr 2007 8,300 Posts

SteveHopwood
Commercial Member

Fantastic. Works a treat. Cheers.

__________________ Never trust my programming. I am an idiot.

Jun 16, 2011 1:46pm

#9 Member Since Nov 2008 601 Posts

flyer415

works great on Win 7 pro __________________ As to methods, there may be a million and then some, but principles are few. The man who grasps

http://www.forexfactory.com/showthread.php?t=299017

09/12/2011

InputResizer: edit EA/Indicator settings comfortably @ Forex Factory

Page 5 of 8

principles can successfully select his own methods.... Ralph Waldo Emerson

Jun 16, 2011 7:20pm

#10 Member Since Sep 2006 4,032 Posts

hanover
Commercial Member

I've had the same problem that I mentioned back in post #2 occur twice more. In both cases I wasn't able to get a screenshot, which is frustrating. I think it might have something to do with having had the indy on the 'Colors' tab when its settings were last edited. Then I attach the latest version of InputResizer EA on the same chart, and use the default parameter settings. Then I press Ctrl-I and edit the indy, I get a strange indicator parameter window that shows only 'chunks' of the each field, at which point MT4 locks up completely, and the only way I've found to close it is Task Manager's 'End Process'. I will keep trying different scenarios, in the hope of having an opportunity to capture a screenshot. Attached is a screenshot of another interesting 'bug'. When dragging (resizing) the parameters window downward, the window went completely blank, and I obtained selected parameters (shown) by clicking randomly within the window. But then when I switched to a different app, and then back to MT4, all of the parameters magically returned. There is no lock up in this situation. All of the above is happening on GO Markets MT4 build 402. I am running Win XP Home SP2. I have a number of other 'background' apps running, but I have no idea if or how they could be causing conflicts. I have also been trying various scenarios on Vantage FX MT4 build 392, and have yet to encounter either of these problems.
Attached Thumbnails

__________________ For a list of indicators and EAs written by hanover, see the foot of this post.
Last edited Jun 16, 2011 7:30pm

Jun 16, 2011 9:52pm

#11 Member Since Jun 2011 414 Posts

MaryJane
Consolidating myself

Quote:

Originally Posted by hanover All of the above is happening on GO Markets MT4 build 402 David, there seems to be some problems of that sort with build 402. Take a look here and there. I have traced the run of

http://www.forexfactory.com/showthread.php?t=299017

09/12/2011

InputResizer: edit EA/Indicator settings comfortably @ Forex Factory

Page 6 of 8

the EA and there are really strange things going on. First: if e.g. timeframe switched, the IsStopped() mql4 function returns true. It's a known (obviously undocumented) fact that while IsStopped() = true, calling any user32.dll function causes the MT4 to hang for a few seconds. That's fine, but I registered that IsStopped() apparently remains true after a TF change sometimes (!) in build 402. In one case I noticed it turned true and back to false for two seconds, without doing anything anywhere, without any reason. That's crazy. Second: InputResizer changes attributes of the input window so Windows start to treat it as resizable. Hence arrows appear when you hover borders with mouse pointer, and the window actually resizes as we are used to. But the controls inside (buttons, tabs, the form) stay unresized at their original places:

The reason for that is MT4 calls the DWM (Desktop Window Manager) to plot and manage the window and passes its style as non-resizable. I can't patch the MT4 executable to change this tiny bit since it's packed (protected against reverse engineering the code) with Themida. And I don't know of any way of telling the DWM to do the unexpected since i'm not MT4 - the application that ordered the window. So there's only one way - once IR makes the window resizeable and applies init coordinates, it checks if the window was resized between ticks (indy) or sleep interval (EA), and if yes, then all the inner elements are moved/sized one-by-one as necessary, relative to new position/size. Now, if IsStopped() becomes true, the EA has cca 2 seconds to complete its operation. That's ok if there are reasons for it to be true; the legitimate reasons are: TF switch, EA detachment, account change, own settings change. Maybe there are some others, but I can't imagine a legit reason for IsStopped() to become true while you have (some) input window open. But it simply happens. I guess the hang is caused by the EA calling the Windows API and forcedly being stopped by MT4 in the middle of something. Of course, I might be wrong. The missing repaint (your pic) issue can happen sometimes; it's exactly as you describe. It's an innocent bug and I think we have to live with it. The content is correct, just not drawn. This is (again) caused by the fact the DWM doesn't care of our window. There's a function in code:
Code:

// This causes the box to redraw, otherwise we get artefacts InvalidateRect(pWnd, s, true);

that takes care of repainting the content if we spot the coordinates changed. In previous version this was done if width or height changed, now we repaint even if just dragged. I tried to do this on every tick / pass, but it flickers badly. For now, I removed all references to IsStopped() in the EA code. The drawback now is slow response on switching timeframes, but the EA should not lose focus with the API now. I recommend to attach the EA to a dedicated chart. It can reside in any running instance on your PC. Update in post #1, please try out and let me know. I very appreciate your assistance. However, I see that's really out of sense to have this window hack implemented in (any) mql4 form.. I will code this utility as a native Win32 application, sitting in the system tray. And I guess all problems will be gone. Never done it, but hey, I need to learn it I want to code my own platform for testing in next yrs. Thanks to all who like it!
Last edited Jun 17, 2011 2:16am | Reason: spelling

http://www.forexfactory.com/showthread.php?t=299017

09/12/2011

InputResizer: edit EA/Indicator settings comfortably @ Forex Factory

Page 7 of 8

Jun 16, 2011 10:24pm

#12 Member Since Sep 2006 4,032 Posts

hanover
Commercial Member

Quote:

Originally Posted by MaryJane David, there seems to be some problems of that sort with build 402. ...... Thanks for your very comprehensive reply. Makes me feel very humble. Skimming through the code in the EA, you've apparently done an impressive amount of research to get this up and running. I'm especially interested in your comments about IsStopped(), as I've used it liberally in some of my own code, where I haven't noticed any problems, but then I rarely do anything as 'low level' as calling the Win API. The MetaQuotes doc about IsStopped() is characteristically skimpy. I'll try the latest version that you've posted and report back. __________________ For a list of indicators and EAs written by hanover, see the foot of this post.

Jun 16, 2011 10:34pm

#13 Member Since Jun 2011 414 Posts

MaryJane
Consolidating myself

Quote:

Originally Posted by hanover ...you've apparently done an impressive amount of research to get this up and running. I'm especially interested in your comments about IsStopped().... Trial-and-error approach I usually make something work and then I start to learn why does it work won't stop until I get it because of repeatability. . But I

Generally, there's nothing wrong with IsStopped(), I just think the IsStopped() function or something with the API calls might be flawed in build #402 GoMarkets is using. Note that MQ releases numerically identical, but internally different builds recently (I know for sure this is true for #391, source: birt's tickdata conversion scripts). With FinFX #402, there's nothing weird with IsStopped() or the calls, as per my recent observation. Another interesting connection is some users claiming RenkoLiveChart_v3.2 (calls the API frequently) to freeze MT4 after #402 update. But I might be completely wrong. Maybe someone who really hacks the mql4 + WinAPI combo would be laughing wildly observing my noobish code.
Last edited Jun 17, 2011 3:30am | Reason: reClarify

Jun 17, 2011 4:57am

#14 Member Since Dec 2010 28 Posts

Ray Singcar
Member Thanks

MaryJane Great utilty, many thanks for your hard work and sharing Ray

Jun 28, 2011 12:59pm

#15 Member Since Jul 2007 980 Posts

Freddyfx
Dutchman in Puerto Vallarta-Mexico

MaryJane. A step closer to perfection of EA settings, GRACIAS! __________________ Trading forex is easy, making money is simple. It is the mental part that is difficult.

http://www.forexfactory.com/showthread.php?t=299017

09/12/2011

InputResizer: edit EA/Indicator settings comfortably @ Forex Factory

Page 8 of 8

Page 1 of 5 1 2 3 4 5 >

1 Trader Viewing This Thread (0 are members)

Similar Threads Thread Simple indicator edit job need some help to edit indicator Advice/Criticism on Indicator Settings for 30M and 2H Changing indicator settings..yes or no? How to save indicator settings? Thread Starter A-game xelax talljoker big_pipin pipcruiser Forum Platform Tech Platform Tech Rookie Discussion Trading Discussion Platform Tech Replies 6 1 0 2 2 Last Post Aug 20, 2010 9:29am May 5, 2010 2:02pm Jan 14, 2009 12:11am Jul 7, 2008 11:28am Aug 3, 2007 11:16am

Email This Page Bookmark This Page Share on Facebook

Website Homepage Search User Guide Member List Online Now

Products Forums Calendar News Market Trades Trade Explorer

Company About FF FF Blog Careers at FF Preferred Brokers

Connect Contact FF Report a Bug Facebook Page RSS Feeds

Top of Page

Forex Factory, Inc. | Terms of Use | Privacy Policy

http://www.forexfactory.com/showthread.php?t=299017

09/12/2011

Das könnte Ihnen auch gefallen