How to send EA order notification to LINE

If you want to notify EA open order / close order signal to LINE, you can use the following code.

input string Token =”YOUR LINE TOKEN”;

void message(string Message){

string headers;char data[], result[];

headers=”Authorization: Bearer “+Token+”\r\n application/x-www-form-urlencoded\r\n”;

ArrayResize(data,StringToCharArray(“message=”+Message,data,0,WHOLE_ARRAY,CP_UTF8)-1);

int res = WebRequest(“POST”, “https://notify-api.line.me/api/notify”, headers, 0, data, data, headers);
if(res==-1)
{
Print(“Error in WebRequest. Error code =”,GetLastError());
MessageBox(“Add this URL ‘https://notify-api.line.me’ on ‘Expert Advisors'”,”Error”,MB_ICONINFORMATION);
}
}

 

Then just add

message(“Order was placed”) into your Ordersend code.

1 個のコメント

  • Leave a Reply

    Your email address will not be published. Required fields are marked *