MT4 PHP Quotes

easy direct connection to any MT4 and MT5 server

MT4 PHP Quotes

function quotes()
{
    require_once("http://localhost:8080/JavaBridge/java/Java.inc");
    echo "Connecting to server...\n";
    $qc = new java("online.mtapi.mt4.QuoteClient", 55967934, "ov2osqv""88.212.244.84", 1951);
    $qc->Connect();
    echo "Connected =  ".$qc->AccountBalance()."\n";
    $symbol = "EURUSD";
    $qc->Subscribe($symbol);
    while(java_is_null($qc->GetQuote($symbol)))
        sleep(1);
    $quote = $qc->GetQuote("EURUSD");
    echo "Bid = ".$quote->Bid." Ask = ".$quote->Ask."\n";
    echo "Press ENTER to exit...\n";
    $qc->Disconnect();
    $line = fgets(fopen ("php://stdin","r"));
}

Leave a Reply