Is this even possible in MQ4? (Capslock Toggle) - Page 2
Page 2 of 612 FirstFirst 12
Results 11 to 15 of 15

Thread: Is this even possible in MQ4? (Capslock Toggle)

  1. #11
    No, you're missing the idea. I'm not changing time frames. Each of the time toggle does is create some indiors disappear when the toggle is pressed.

  2. #12
    There probably is a workaround with the windows api.

    I did some extensive gui material with mt4 earlier (like guide trader during backtest...).

    Just some food for thought:


    A script generates and modifies a GlobalVariable. 1 if caps is pressed 0 (cautious GlobalVariableGet returns 0 if an error occurs...) if it's released. You can do that by binding the script to caps (not positive if you really can bind a script to simply covers lock... but another key combination will be sufficient).

    And now add the following code to your Indior:

    Inserted Code if(Period() == 1 GlobalVariableGet(Caps Symbol()) )
    GlobalVariableGet returns a double value so that you might need to add another check to make it failproved


    -----------------------
    Choice but not so wonderful way...

    Create a script which will put a hidden object on the chart. Scripts can be jumped to shortcuts. The EA then checks whether the thing exist if it will it delete it performs a task based on that. Based on that it's possible to set the visibility of the indior. It is messy but it works.

  3. #13
    Now that's a great idea!! I will have a think about how to implement it... im not the worlds best coder but that seems ideal! I'm not dead set on the caps key, that will likely cause unnecessary problem to establish as a hot-key for your own script. That seems like a wonderful idea though! Thank you!
    M

  4. #14
    The script May look something like That:

    Inserted Code int Begin () string name = Hide Symbol(); if (GlobalVariableCheck(name)) switch (GlobalVariableGet(name)) case 1: GlobalVariableSet(name,2); break; case Two: GlobalVariableSet(name,1); break; default: ;// Publish Error Handling; else GlobalVariableSet(name,1); return(0);
    The short version May also work:

    Inserted Code int start() string name = Hide Symbol(); if(!GlobalVariableSetOnCondition(name,2,1)) GlobalVariableSet(name,1); return(0);
    I have not worked with mql4 a long time but in Java you are supposed not to directly compare a double and an int value because it happens that a two could be represented as something similar to 1,9999999999999999 which cause the change statement to fail. I don't think that occurred in mql4 though. If you experience any trouble attempt to normalize the dual or convert it to an integer.
    Ahh I discovered something. If you are bored you can start reading this article http://forum.mql4.com/4647

  5. #15
    Quote Originally Posted by ;
    I despise my charts becoming cluttered but there are a few indiors such as DMAs, Daily Tenkan Sen and Kijun Sen traces, VWAP etc I feel I need to view from time to time whilst devising my egy. The apparent solution would be to have two similar templates and flip between both, however if I place trendlines and fibs or whatever on the charts, they'll be deleted when I flip chart template unless I save a pair of templates for every currency pair im trading etc etc it all gets messy. Might it be possible to incorporate some code into an indior which toggles...
    Do you mean you stay in the exact same chart window and then just switch template and period inside it? Simplest solution is, open the same currency pair in different windows, optimize themthen you can switch between the timeframes by altering the windows. So then you have your messy M1 chart down there, you can click and view it whenever you like to, then simply switch back to your normal chart right alongside it.

    If you want the script to consciously respond to any key you press, that is not possible inside the scripting terminology mq4 itself. You would have to load a dll for it.

    And with the latest update to build 500, I think Metaquotes even made it more challenging to call outside dll files or burden themwhich I think is a very bad move of those. Many programmers who developed advanced tools for metaquotes utilize dll to embed more innovative features. And now their resources dont work with the newest version... But I do not know if they disallowed to call dll files inside mq4 completely.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.