Deprecated: Assigning the return value of new by reference is deprecated in /var/www/xelsson.se/public_html/wordpress/wp-settings.php on line 520

Deprecated: Function set_magic_quotes_runtime() is deprecated in /var/www/xelsson.se/public_html/wordpress/wp-settings.php on line 18

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl(&$output) in /var/www/xelsson.se/public_html/wordpress/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl(&$output) in /var/www/xelsson.se/public_html/wordpress/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el(&$output) in /var/www/xelsson.se/public_html/wordpress/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el(&$output) in /var/www/xelsson.se/public_html/wordpress/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el(&$output) in /var/www/xelsson.se/public_html/wordpress/wp-includes/classes.php on line 1244

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl(&$output) in /var/www/xelsson.se/public_html/wordpress/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl(&$output) in /var/www/xelsson.se/public_html/wordpress/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el(&$output) in /var/www/xelsson.se/public_html/wordpress/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el(&$output) in /var/www/xelsson.se/public_html/wordpress/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el(&$output) in /var/www/xelsson.se/public_html/wordpress/wp-includes/classes.php on line 1442

Strict Standards: Redefining already defined constructor for class wpdb in /var/www/xelsson.se/public_html/wordpress/wp-includes/wp-db.php on line 306

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /var/www/xelsson.se/public_html/wordpress/wp-includes/cache.php on line 431

Strict Standards: Declaration of Walker_Comment::start_lvl() should be compatible with Walker::start_lvl(&$output) in /var/www/xelsson.se/public_html/wordpress/wp-includes/comment-template.php on line 1266

Strict Standards: Declaration of Walker_Comment::end_lvl() should be compatible with Walker::end_lvl(&$output) in /var/www/xelsson.se/public_html/wordpress/wp-includes/comment-template.php on line 1266

Strict Standards: Declaration of Walker_Comment::start_el() should be compatible with Walker::start_el(&$output) in /var/www/xelsson.se/public_html/wordpress/wp-includes/comment-template.php on line 1266

Strict Standards: Declaration of Walker_Comment::end_el() should be compatible with Walker::end_el(&$output) in /var/www/xelsson.se/public_html/wordpress/wp-includes/comment-template.php on line 1266

Strict Standards: Redefining already defined constructor for class WP_Dependencies in /var/www/xelsson.se/public_html/wordpress/wp-includes/class.wp-dependencies.php on line 31

Strict Standards: Redefining already defined constructor for class WP_Http in /var/www/xelsson.se/public_html/wordpress/wp-includes/http.php on line 61
What to do… » 2012 » August

Archive

Archive for August, 2012

Take screenshots at trade

August 21st, 2012

I’m kicking myself for not implementing this earlier (actually I did implement it a while ago, but didn’t start using it until a few days ago), so I thought I would share some code for once to help out anyone writing and optimizing their own MT4 strategies. I simply call this function after I have taken a position, which saves the current graph (including any information written on it) for later inspection. I have found that this greatly helps me analyse the trade afterwards.

extern int  ScreenShotWidth = 1200;
extern int  ScreenShotHeigth = 1000;
void TakeScreenShot(int ticket) {

string ScreenShotFileName = StringConcatenate(”Purple_EA_”,Symbol(),”_”,DoubleToStr(ticket,1),”.gif”);

if (WindowScreenShot(ScreenShotFileName,ScreenShotWidth,ScreenShotHeigth)) {

//WriteLog(”Screenshot taken: “+ScreenShotFileName);

}

else {

//WriteLog(”Screenshot failed: “+DoubleToStr(GetLastError(),1));

}

}

Just call the method with the ticketnumber of the trade. This will dump the current graph and all eventual indicators and visible objects to a screenshot.