How to set current path as root path?

 

Hey guys,

I want to use the Forex Factory News indicator! Before it works you have to download the news from there database with this script (it´s only a part of the code)

I have more than 1 Mt4 station on my PC and it´s troublesome to specific the path everytime I want to download the news from there database

How is it possible that the news.csv will saved in the CURRENT directory in the subfolders: experts/files ?


#import "kernel32.dll"
   void OutputDebugStringA(string a0);
#import "shell32.dll"
   int ShellExecuteA(int a0, string a1, string a2, string a3, string a4, int a5);
#import "wininet.dll"
   int InternetAttemptConnect(int a0);
   int InternetOpenA(string a0, int a1, string a2, string a3, int a4);
   int InternetOpenUrlA(int a0, string a1, string a2, int a3, int a4, int a5);
   int InternetReadFile(int a0, int& a1[], int a2, int& a3[]);
   int InternetCloseHandle(int a0);
#import

extern string FilesFolder = "c:\\Program Files\\______\\experts\\files";
extern bool AutoplayMode = TRUE;
int gsa_unused_88 = 0;
int g_datetime_100;
int g_datetime_104;
int g_str2time_108;
int gi_112;

int start() {
   int l_file_0;
   g_datetime_104 = TimeCurrent();
   g_datetime_100 = TimeLocal();
   g_str2time_108 = StrToTime(DateToStr(g_datetime_100 - 86400 * TimeDayOfWeek(g_datetime_100), "Y.M.D"));
   gi_112 = g_str2time_108 / 86400 + 61730;
   if (AutoplayMode) {
      l_file_0 = FileOpen("Autoplay.CSV", FILE_CSV|FILE_WRITE, ';');
      FileWrite(l_file_0, NumberToStr(gi_112, "TR6"));
      FileClose(l_file_0);
      Sleep(2000);
   }
   ShellExecuteA(0, "open", FilesFolder + "\\ffcal.exe", "", FilesFolder, 3);
   return (0);
}

string DateToStr(int ai_0, string as_4 = "") {
   string ls_96;
   string ls_116;
   string ls_12 = "";
   string ls_20 = "";
   if (StringSubstr(as_4, 0, 1) == "\'") {
      for (int li_28 = 1; li_28 < StringLen(as_4); li_28++) {
         if (StringSubstr(as_4, li_28, 1) == "\'") break;
         ls_12 = ls_12 + StringSubstr(as_4, li_28, 1);
      }
      as_4 = StringSubstr(as_4, li_28 + 1);
   }
   if (StringSubstr(as_4, StringLen(as_4) - 1, 1) == "\'") {
      for (int li_32 = StringLen(as_4) - 2; li_32 >= 0; li_32--) {
         if (StringSubstr(as_4, li_32, 1) == "\'") break;
         ls_20 = StringSubstr(as_4, li_32, 1) + ls_20;
      }
      as_4 = StringSubstr(as_4, 0, li_32);
   }
   if (as_4 == "") as_4 = "Y.M.D H:I:S";
   string lsa_36[12] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
   string lsa_40[7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
   int l_day_44 = TimeDay(ai_0);
   int l_month_48 = TimeMonth(ai_0);
   int l_year_52 = TimeYear(ai_0);
   int l_day_of_week_56 = TimeDayOfWeek(ai_0);
   int l_hour_60 = TimeHour(ai_0);
   int l_minute_64 = TimeMinute(ai_0);
   int l_second_68 = TimeSeconds(ai_0);
   bool li_72 = FALSE;
   if (StringFind(StringUpper(as_4), "A", 0) >= 0) li_72 = TRUE;
   int li_76 = 12;
   if (l_hour_60 > 12) li_76 = l_hour_60 - 12;
   else
      if (l_hour_60 > 0) li_76 = l_hour_60;
  
 

can someone help me edit sar ohlc to use heiken ashi ohlc

Hi, I have an MTF indicator that uses sar, however I'd like the sar to calculate heiken ashi ohlc, and not the normal type

Can you tell me how I can do this, my mtf indicator calls to the sar indicator to calculate sar formula, I think it is calling to the internal indicator in mt4 that can not edit

you can skype or email if you can assist and like to talk about it

skype sty671

email sty671@gmail.com

I can also supply the original file that I'm trying to use heiken ashi ohlc for

Reason: