Forex Factory (https://www.forexfactory.com/forum.php)
-   Platform Tech (https://www.forexfactory.com/forumdisplay.php?f=69)
-   -   Take pics from different TF at same time... (https://www.forexfactory.com/showthread.php?t=354654)

crusader1 Apr 16, 2012 5:31am | Post# 1

Take pics from different TF at same time...
 
Hi guys

Is there some way that I can take pics from MT4 chart in same time from different TF.
For example my EA is running on 5M chart and after some conditions are there it will take pics not only from 5M chart but also from 30M and 1H chart.
Can I code something like this?

Thanks

CodeMeister Apr 16, 2012 12:58pm | Post# 2

Try This
 
What you are suggesting can be done in theory, but once you understand the obstacles, you probably won't do it. It can only be done in code with the WindowScreenShot() function. It has to be done in an EA and the EA must be attached to the charts for which a screenshot is desired. So in your case, the must be running on the 5M, 30M and 1HR. You would have to decide what the trigger event(s) are and how ensure each EA is triggered simultaneously which might be easy or difficult.

crusader1 Apr 17, 2012 9:22am | Post# 3

What you are suggesting can be done in theory, but once you understand the obstacles, you probably won't do it. It can only be done in code with the WindowScreenShot() function. It has to be done in an EA and the EA must be attached to the charts for which a screenshot is desired. So in your case, the must be running on the 5M, 30M and 1HR. You would have to decide what the trigger event(s) are and how ensure each EA is triggered simultaneously which might be easy or difficult.


OK. I am understand it correctly that I must run all three TFs in one terminal?
For example if I am checking on EU. I will have open 5M on EU 30M on EU and 1H on EU?
It is not possible to do only with one running TF??

Thanks

CodeMeister Apr 17, 2012 3:42pm | Post# 4

No
 
The screenshot EA has to be running on the desired chart(s).

scalpz Apr 17, 2012 10:01pm | Post# 5

Way I see it
 
What you are suggesting can be done in theory, but once you understand the obstacles, you probably won't do it. It can only be done in code with the WindowScreenShot() function. It has to be done in an EA and the EA must be attached to the charts for which a screenshot is desired. So in your case, the must be running on the 5M, 30M and 1HR. You would have to decide what the trigger event(s) are and how ensure each EA is triggered simultaneously which might be easy or difficult.
Sounds like having your current ea takes its pic & alters a Global variable, maybe with a time stamp.
On each of the 2 higher TF charts, you run a different ea which is only checking the Global variable at the close of their candles (hence the time stamp) and they take a picture each.
Waiting for the higher TF ea's bars to close would cut back on cpu use.

cheers scalpz

crusader1 Apr 18, 2012 3:36am | Post# 6

thanks guys for ideas!!
Looks very complicated because I am watching 8 pairs at same time.
I will have then 8*3=24 charts which will be total mess
and also CPU will we very loaded.

but again many thanks

MT4Coder Apr 22, 2012 11:02am | Post# 7

I don't believe the CPU will be overloaded. You simply run the EA on your main timeframe and then run a different EA on the others. This second EA will not perform anything other than checking for a signal telling it to take a screenshot. The signal can be generated by the main EA in a text file (e.g. it could write a blank text file called "h1.txt" when it needs a H1 screenshot). The second EA could check for the presence of h1.txt on every new M5 bar (if your main EA is running on M5), if it's there then delete it and take a screenshot. Same for other timeframes.

An alternative is to generate your own charts from a single EA. You can use a javascript library like highcharts.com which has the facility to generate financial charts. Your EA would simply pass the chart data to a function that generates the chart as a HTML page.

CockeyedCowboy Apr 22, 2012 5:26pm | Post# 8

2 Attachment(s)
crusader


I dont know anything about your set up so I made a general purpose indicator to take screen shots of the 3 screens. its an indicator so it goes into the indicator file.

theres a script that will generate ticks to make it work off line and or in real time on line.

put the indicator on your set up and the script file on a seperate window dont matter which, but turn the external variable 'FillRequests = True' that will make the tick generate send ticks to other windows that request
them.

the indicator is already set up to receive ticks.


Your can not run a scritp on the window this indicator is on but EAs will can run so you can incorporate this indicator into your current EA.

What this does is rotate the windows into the 3 time periods and takes a screen shot and ending up back into the original time period.

to make it work open up the indicator dialog box and set the 'TimeForPhotos = True'

This is not a finished code as it should be incorporated into your existion code, it is just a smaple for what can be done. Donot trade using this indicator in its present form.


The attached screen shot is the sample one that the indicator is on, it just has common built in indicator. there is a file in the Zip that has sample screen shots the name of the screen shots have the chart period in it to tell which there are, you have to do any time stamping that you require,

Keit







Hi guys

Is there some way that I can take pics from MT4 chart in same time from different TF.
For example my EA is running on 5M chart and after some conditions are there it will take pics not only from 5M chart but also from 30M and 1H chart.
Can I code something like this?

Thanks
Click to Enlarge

Name: Test of Photo indicator.jpg
Size: 44 KB
Multiple Screen Shots .zip

bandung Apr 23, 2012 1:50am | Post# 9

crusader


I dont know anything about your set up so I made a general purpose indicator to take screen shots of the 3 screens. its an indicator so it goes into the indicator file.

theres a script that will generate ticks to make it work off line and or in real time on line.

put the indicator on your set up and the script file on a seperate window dont matter which, but turn the external variable 'FillRequests = True' that will make the tick generate send ticks to other windows that request
them.

the indicator is already set up...
Keit... never knew you code is like that
I'm feeling like reading a man page

CockeyedCowboy Apr 23, 2012 11:54am | Post# 10

2 Attachment(s)
bandung

what are you saying???



Keit... never knew you code is like that
I'm feeling like reading a man page


You may be like this one beter. Its a currency portfolio reserach tool. attach it to a chart and what ever indicators you use to eveuate the market and it will let you see each currentcy in your portfolio.

Read the documentation about creating your custom portfolio file This code will create a temperay one for you with all the majors and minors but you can change it to what ever you follow and or your broker offers.

Keit
Click to Enlarge

Name: Market Research indicators.jpg
Size: 40 KB
Portfolio Market Research.zip

emmanuel7788 Apr 23, 2012 8:55pm | Post# 11

crusader


I dont know anything about your set up so I made a general purpose indicator to take screen shots of the 3 screens. its an indicator so it goes into the indicator file.

theres a script that will generate ticks to make it work off line and or in real time on line.

put the indicator on your set up and the script file on a seperate window dont matter which, but turn the external variable 'FillRequests = True' that will make the tick generate send ticks to other windows that request
them.

the indicator is already set up to receive...
Hi Keith,

WOW!
This works great!.
Some super programming done here.
Never knew it could be done this way. Thanks you for sharing these.
Will continue to use this and try out more posibilities.

Regards,

CockeyedCowboy Apr 24, 2012 1:04pm | Post# 12

Remember its only a tool, you must add your own indicators to derive any thing from it. and do not trade from any window that contains this rotation engine. also you can not have any scripts on this window as MT will force them to end on changes to the symbol. BUT this code like the one above it has a built in request for ticks, which means that if you take the tick generator as posted in the post above and run that tick generator in a seperate window any window and turn 'FillRequest = True' in the dilalop box it will make this (the portfolio code) run in real time a big inprovement over tick wise.

Keit



Hi Keith,

WOW!
This works great!.
Some super programming done here.
Never knew it could be done this way. Thanks you for sharing these.
Will continue to use this and try out more posibilities.

Regards,

bandung Apr 24, 2012 8:37pm | Post# 13

bandung

what are you saying???







You may be like this one beter. Its a currency portfolio reserach tool. attach it to a chart and what ever indicators you use to eveuate the market and it will let you see each currentcy in your portfolio.

Read the documentation about creating your custom portfolio file This code will create a temperay one for you with all the majors and minors but you can change it to what ever you follow and or your broker offers.

Keit
Thanks Keit, i enjoying reading your code,
and this one(rotation engine) is really neat


© Forex Factory