Please help to modify higher/lower from rise/fall

Hi everyone,

I saw the trade4me, we can use the custom indicator to make EAto trade in binary.com, but just for rise/fall option. Please help me modify to use the higher/lower option. Thank you

Here I attached the file they use for rise/fall option EA ( It contain 1 function and 1 EA for working properly)

1.Trade4me function.mqh

//+------------------------------------------------------------------+
//| !Trade4me_functions.mqh |
//| SAS NEUTRINO |
//| http://Trade4.me |
//+------------------------------------------------------------------+

property copyright "SAS NEUTRINO"

property link "https://Trade4.me"

define READURL_BUFFER_SIZE 1000

import "wininet.dll"

int InternetOpenW(string, int, string, string, int);
int InternetOpenUrlW(int, string, string, int, int, int);
int InternetCloseHandle(int);
int InternetReadFile(int, uchar & arr[], int, int & arr[]);

import

string trade4me(string Username,string Password,string Asset,string Direction,string Barrier,string Expiry,string Investment){
string str = ReadUrl("https://trade4.me/order.php?username="+Username+"&password="+Password+"&asset="+Asset+"&direction="+Direction+"&expiry="+Expiry+"&amount="+Investment+"&rand="+IntegerToString(MathRand()));
return str;
}

string trade4me_balance(string Username,string Password){
string str = ReadUrl("https://trade4.me/balance.php?username="+Username+"&password="+Password+"&rand="+IntegerToString(MathRand()));
return str;
}

string trade4me_history(string Username,string Password,string HowMany){
string str = ReadUrl("https://trade4.me/history.php?username="+Username+"&password="+Password+"&fetch="+HowMany+"&rand="+IntegerToString(MathRand()));
return str;
}

string ReadUrl(string Url, bool PrintDebuggingMessages = false)
{
string strData = "";
bool bSuccess = false;

// Get an internet handle
int hInternet = InternetOpenW("mt4", 0 /* 0 = INTERNET_OPEN_TYPE_PRECONFIG */, NULL, NULL, 0);
if (hInternet == 0) {
if (PrintDebuggingMessages) Print("InternetOpenW() failed");

} else {
// Get a URL handle
int hInternetUrl = InternetOpenUrlW(hInternet, Url, NULL, 0, 0, 0);
if (hInternetUrl == 0) {
if (PrintDebuggingMessages) Print("InternetOpenUrlW() failed");

  } else {
     if (PrintDebuggingMessages) Print("Okay: url handle: ", hInternetUrl);

     // We potentially (in fact, usually) get the response in multiple chunks
     // Keep calling InternetReadFile() until it fails, or until
     // it says that the read is complete
     bool bKeepReading = true;
     while (bKeepReading) {                    
        int szRead[1];
        uchar arrReceive[];
        ArrayResize(arrReceive, READURL_BUFFER_SIZE + 1);
        int success = InternetReadFile(hInternetUrl, arrReceive, READURL_BUFFER_SIZE, szRead);

        if (success == 0) {
           if (PrintDebuggingMessages) Print("InternetReadFile() failed");
           bKeepReading = false;

        } else {
           // InternetReadFile() has succeeded, but we may be at the end of the data 
           if (szRead[0] == 0) {
              if (PrintDebuggingMessages) Print("Reached end of data");
              bKeepReading = false;
              bSuccess = true;

           } else {
              // Convert the data from Ansi to Unicode using the built-in MT4 function
              string strThisRead = CharArrayToString(arrReceive, 0, szRead[0], CP_UTF8);
              strData = strData+strThisRead;
           }
        }
     }
     InternetCloseHandle(hInternetUrl);
  }
  InternetCloseHandle(hInternet);

}

return (strData);
}

  1. This is EA example:

//+------------------------------------------------------------------+
//| !Trade4me_EA.mq4 |
//| SAS NEUTRINO |
//| http://Trade4.me |
//+------------------------------------------------------------------+

property copyright "SAS NEUTRINO"

property link "http://Trade4.me"

property version "1.00"

property strict

include "..\Include!Trade4me_functions.mqh"

double buy;
double sell;
datetime time0;

int OnInit(){
return(INIT_SUCCEEDED);
}

void OnTick()
{
if(Time[0]!=time0) { //We limit signals to one per candle.
sell=iRSI(NULL, PERIOD_CURRENT, 3, PRICE_CLOSE, 1)>80
buy=iRSI(NULL, PERIOD_CURRENT, 3, PRICE_CLOSE, 1)<20
if(sell!=0){
string response = trade4me("Username", "password", Symbol(), "DOWN", "15", "25"); //We send a signal
Alert(response); //We display the server response
time0=Time[0]; //We set time0 to the time of the current candle so we don't send another signal during this candle
} else if(buy!=0){
string response = trade4me("username", "password", Symbol(), "UP", "15", "25"); //We send a signal
Alert(response); //We display the server response
time0=Time[0]; //We set time0 to the time of the current candle so we don't send another signal during this candle
}
}
}

Thank you.

Sign In or Register to comment.