Custom folder outside MT4

 

Hi there:-)

I'm new to coding in MT4 and would love if someone would be so kind to guide me in the right direction:-)

I have attached an indicator that works brilliant... It automatically saves a screenshot when you open and close a trade... My problem is that i would like to set a custom folder outside MT4 if possible. 

Here is a snip of the code where folder is mentioned - And i have attached the indicator aswell:-)

//+------------------------------------------------------------------+

//|                                            ScreenShotOnTrade.mq4 |

//|                                                      nicholishen |

//|                            http://www.reddit.com/u/nicholishenFX |

//+------------------------------------------------------------------+

#property copyright "nicholishen"

#property link      "http://www.reddit.com/u/nicholishenFX"

#property version   "1.00"

#property strict

#property indicator_chart_window


//+------------------------------------------------------------------+

#include <Arrays\ArrayInt.mqh>

#include <ChartObjects\ChartObjectsLines.mqh>


class ScreenShot

{

private:

   CArrayInt      m_list;

   bool           m_init;

   int            m_magic;

   string         m_folder;

   int            m_orders_total;

public:

   ScreenShot(int magic_number): m_init(false),

                                 m_magic(magic_number),

                                 m_folder("screenshots\\"+Symbol()+"\\"),

                                 m_orders_total(-1)

                                 {}


if someone could guide me i would be highly appreciative:-) Thanx in advance

Files:
 

You have to use Windows kernel32.dll. Here is an example: https://www.mql5.com/en/articles/2720.

For more of this search: https://www.mql5.com/en/search#!keyword=kernel32.dll&method=2

MQL5 Programming Basics: Files
MQL5 Programming Basics: Files
  • www.mql5.com
This practice-oriented article focuses on working with files in MQL5. It offers a number of simple tasks allowing you to grasp the basics and hone your skills.
 
Thank you very much Carl - I will have a look at it:-)
 
  1. Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
    Next time, post in the correct place. The moderators will likely move this thread there soon.

  2. Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
              Messages Editor

  3. clauscbh: i would like to set a custom folder outside MT4 if possible. 
    Create a junction (mklink /J) at «DataFolder»\MQL4\Files\«other place» and have SnapShot write the file there.