Download MetaTrader 5
To add comments, please log in or register
Have you found an error in our products? Apply to Service Desk!
Sameer
804
Sameer 2010.02.10 16:50 
Hi all,

Could someone provide a code to Flip Charts Automatically

I don't want to click or press Ctrl+tab.... just got sick of it

Cheers
pfx
88
pfx 2010.02.11 11:10  
t4fast wrote >>
Hi all,

Could someone provide a code to Flip Charts Automatically

I don't want to click or press Ctrl+tab.... just got sick of it

Cheers

What do you mean by Flip Charts Automatically?

fbj
1047
fbj 2010.02.11 11:29  

afaik, not poss inside Terminal...

Perhaps running a script/.exe [outside Terminal] might do it, such as AutoHotKey

But, you will still have to click/hotKey to get it going :)

JC
1454
JC 2010.02.11 13:02  
t4fast:
Could someone provide a code to Flip Charts Automatically

Not sure what advantage code such as this is meant to have over pressing Ctrl+Tab, but I think it does what you want...


#import "user32.dll"
   int GetParent(int hWnd);
   int SendMessageA(int hWnd, int Msg, int wParam, int lParam);
#import

#define WM_MDINEXT   548

void start()
{
   int hMDI = GetParent(GetParent(WindowHandle(Symbol(), Period())));
   SendMessageA(hMDI, WM_MDINEXT, 0, 0);
}
gordon
2326
gordon 2010.02.11 13:13  
jjc:

Not sure what advantage code such as this is meant to have over pressing Ctrl+Tab, but I think it does what you want...

I think the idea is to loop it every X seconds and so have a "slide show" of charts...

JC
1454
JC 2010.02.11 13:23  
gordon:

I think the idea is to loop it every X seconds and so have a "slide show" of charts...

In which case, pretty obviously:

#import "user32.dll"
   int GetParent(int hWnd);
   int SendMessageA(int hWnd, int Msg, int wParam, int lParam);
#import

#define WM_MDINEXT   548

extern int SlideShowSeconds = 5;

void start()
{
   while (!IsStopped()) {
      int hMDI = GetParent(GetParent(WindowHandle(Symbol(), Period())));
      SendMessageA(hMDI, WM_MDINEXT, 0, 0);

      Sleep(SlideShowSeconds * 1000);
   }
}


The fun is that you have to stop the slideshow by removing the script from the chart you originally added it to, not (necessarily) the one currently displayed. Can require a bit of dexterity if SlideShowSeconds is set to a small number.

gordon
2326
gordon 2010.02.11 13:33  

jjc wrote >>

The fun is that you have to stop the slideshow by removing the script from the chart you originally added it to, not (necessarily) the one currently displayed. Can require a bit of dexterity if SlideShowSeconds is set to a small number.

:) yeah, could be a pain in the ass.


The first time I read t4fast's request I thought why bother... But I have to admit that this script is actually quite practical in many situations.

Sameer
804
Sameer 2010.02.11 14:43  

Thanks alot guys,


Yes; the idea is "loop it every X seconds and so have a "slide show" of charts"


The script is working fine, Just need to add a text ... "Loop script added here" :)


another bright idea is welcomed.

Sameer
804
Sameer 2010.02.11 22:19  
well, I failed to add a text ! guys; help please.
gordon
2326
gordon 2010.02.12 04:48  
t4fast:
well, I failed to add a text ! guys; help please.

Just add a comment... (or maybe u meant something else?)

#property show_inputs
#import "user32.dll"
   int GetParent(int hWnd);
   int SendMessageA(int hWnd, int Msg, int wParam, int lParam);
#import

#define WM_MDINEXT   548

extern int SlideShowSeconds = 5;

void start()
{
   Comment("Loop script added here!");     // <-  comment
   while (!IsStopped()) {
      int hMDI = GetParent(GetParent(WindowHandle(Symbol(), Period())));
      SendMessageA(hMDI, WM_MDINEXT, 0, 0);

      Sleep(SlideShowSeconds * 1000);
   }
   Comment("");   // <- remove comment at script remove
}
ale
3
ale 2011.06.01 13:29  

Hi guys,


This is really useful.


What I'm trying to do is open 100 symbols for 5 seconds(1 at a time), if a chart interests me I click/push button and it leaves it open and moves onto the next one. If I dont click/push a button then it closes the window.


Any idea's how to incorperate this into my idea?


Currently, I use AutoHotKey to open 20 symbols at a time and I then manually close each other them, then repeat the process until I run out of symbols


Thanks

Ale

/ /12
To add comments, please log in or register