LoadTemplate in MQL
Results 1 to 8 of 38

Thread: LoadTemplate in MQL

  1. #1
    Hello Guys,

    I wondered whether it's possible to load a particular *.tpl using a special purpose?
    Let's say you apply a certain EA and it will have some thing like loadTemplate(mytemplate.tpl); at its init() function?
    I found out how to open a certain chart with the aid of MT4Internal Messages but not how to load a template.

    Enjoy your help!

    Regards,

  2. #2
    Quote Originally Posted by ;
    I wondered if it is possible to load a specific *.tpl with a special purpose?
    I think that it could be done by name but would be quite-a-bit more involved. Below is the simplest way to load a template programmatically I know of.

    Inserted Code int hWnd = WindowHandle( Symbol(), Period() ); PostMessageA( hWnd, WM_COMMAND, 34800, 0 );
    Use 34800 to load the initial template in your template listing.
    Use 34801 to load the second template in your template listing.
    Use 34802 to load the third template in your template listing.
    And so Forth.

    Right click on an MT4 chart and select Template. The order you see that (alphabetically) is that the order used.

    Let us say the initial template in your listing is ATemplate and you want to load it, use:

    PostMessageA( hWnd, WM_COMMAND, 34800, 0 );

    Let us say the second template in your listing is BTemplate and you want to load it, use:

    PostMessageA( hWnd, WM_COMMAND, 34801, 0 );

    So, in case you've got a particular template in mind, just be certain it's at the very top of your listing (begin its name with a 0) and utilize the 34800 value in the PostMessageA call.

  3. #3
    Thanks I will try this out.

    How did you discover that? Things like this are not recorded. I'd also be curious about how to Show an Object. For example you have a bunch of vertical lines. If you go to a Obeject Manager and select them and click Display the Windows will automatically jump to this position.

    Regards,

  4. #4
    Quote Originally Posted by ;
    How can you discover that? Unfortunately things like that are not documented.
    In this scenario, I had just awakened with auto templates so that it was fresh in my mind.

    Ordinarily, I'll follow these steps when attempting to figure out how to do something in MQL:

    1) Search my repository of code to find out if I've done something like
    two ) Search mql4.com
    3) Search forexsoutheast.asia.com

    This post includes invaluable information for doing automated tasks in mql:

    http://forum.mql4.com/30667

    Quote Originally Posted by ;
    I would also be interested in how to Show an Object. For instance you have a lot of lines that are vertical. If you go to your Obeject Manager and select them and click Show the Windows will automatically jump to that position.
    I do not know of a way to do this programmatically. I posted this a while ago that really does something like - scrolling numerous charts to precisely the same moment. Perhaps it's possible to use the code as a basis for your situation:

    https://www.forexsoutheast.asia/cryp...e-candles.html
    https://www.forexsoutheast.asia/atta...3555998403.mq4

  5. #5
    Hi would you know how I can reverse this. I'd love to save template. I'm happy to follow along with the structure above if somebody can advise how I can spare to the first template in my listing rather then open

    thanks

  6. #6
    Hi , could you tell me, ' are you still using part of gambler180 system on the 15 min charts or do you exchange otherwise now, look forward to your answer.
    Shane.

  7. #7
    Quote Originally Posted by ;
    quote I think it could be achieved by name but would be quite-a-bit more involved. Below is the simplest way to load a template programmatically I understand. Int hWnd = WindowHandle( Symbol(), Stage () ); PostMessageA( hWnd, WM_COMMAND, 34800, 0 ); Utilize 34800 to load the first template in your template listing. Use 34801 to load the second template in your template listing. Use 34802 to load the next template into your template listing. And so on. Click on an MT4 chart and select Template. The order that you see there (alphabetically) is the order used. Let's...
    How can I use this code to load a template ? I.e. that I want to load a template with the same name as the currency symbol, i.e. EURUSD.tpl

  8. #8
    Hi,

    I don't have any idea if this would work, but try saving your template as default.tpl

    I have not ever used it, but I would presume that the opening of a chart using MT4Internal Messages would simply load up the default template.

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.