Help on {price propoal open contract}

edited May 2016 in General

Hello Guys, help on getting sample code for placing a trade using {price propoal open contract }
example i have a signal from my strategy that i want to Call USD/JPY for 30 Minutes with 100$ investment and the entry price should be 113.788 or lower, and what to do if my strike rate reach 5 minute later ?? because my signal need exactly exipry if its 5Min should be exactly 5, if its 15 then should be it. and so on, any help?

Comments

  • Hi, can you please clarify what exactly are you trying to do ? If it is a 30m CALL, and if the barrier is reached after 5 minutes the contract will become in the money, but will still expire only at the end of 30m as selected earlier.

  • @Rakshit said:
    Hi, can you please clarify what exactly are you trying to do ? If it is a 30m CALL, and if the barrier is reached after 5 minutes the contract will become in the money, but will still expire only at the end of 30m as selected earlier.

    Hi Rakshit, what am trying to say is if a signal was fired at 11::00 for 30 Minutes expiry it should expiry exactly after 30 minutes that mean it will expiry at 11:30 if and only a strike rate met instantly when a signal was fired, so my question is what to do if a strike rate for a signal reached 5 minute later and a trade was taken that mean a trade will expiry at 11:35 hope you get my point because the trike rate reached 5 minute later, i think the idea behind it is decrement every one minute that pass before a strike rate has reached but i don't know how to implement it.

  • edited June 2016

    Hello, help here on how to display return values in HTML example i have executed a balance Request

    {
    "balance": 1
    }

    as you know the output in console will be balance, currency and loginID i need the value of balance, currency and loginID to be displayed in HTML i have used this code to retrieve the data

    function Balance() { var ws = new WebSocket('wss://ws.binaryws.com/websockets/v3'); ws.onopen = function(evt) { ws.send(JSON.stringify({ "authorize": "j00000000000"})); alert("Authorized"); ws.send(JSON.stringify({"balance": 1})); alert("Balance Printed"); }; ws.onmessage = function(msg) { var data = JSON.parse(msg.data); console.log('Balance Sheet: %o', data); document.getElementById("demo").innerHTML=data.balance; }; }

    but it seems not working any help, advice???

    Raunak, Rakshit and other need help here

  • Hello @wolfofwallstreetJr to be easy support you. you must set a description about your returned error.

    You can do something like this.

    `<!DOCTYPE html>

    <script>
        var output;
    
        function Connect() {
            output = document.getElementById("debug");
            var token = document.getElementById("apitoken").value;
            if (token == '') {
                alert("You must add an API Token");
                return;
            }
    
            ws = new WebSocket('wss://ws.binaryws.com/websockets/v3');
            ws.onopen = function(evt) {
                onOpen(evt)
            };
            ws.onmessage = function(evt) {
                onMessage(evt)
            };
        }
    
        onOpen = function(evt) {
            var token = document.getElementById("apitoken").value;
            ws.send(JSON.stringify({
                authorize: token
            }));
        }
    
        onMessage = function(msg) {
            var js = JSON.parse(msg.data);
    
            if (js.error) { //Just for check for error
                writeToScreen("Error: " + js.error.message);
                return;
            }
    
            if (js.msg_type == 'authorize') {
                writeToScreen("Authorized OK:" + "  Email: " + js.authorize.email + "  Account: " + js.authorize.loginid);
            }
    
            if (js.msg_type == 'balance') {
                writeToScreen("Balance: " + js.balance.balance);
            }
    
        }
    
        function GetBalance() {
            if (ws) {
                ws.send(JSON.stringify({
                    balance: 1
                }));
            }
        }
    
        function writeToScreen(message) {
            var pre = document.createElement("p");
            pre.style.wordWrap = "break-word";
            pre.innerHTML = message;
            output.appendChild(pre);
        }
    </script>
    
    API TOKEN:<input type="text" id="apitoken" name="apitoken"><br><br>
    <button type="button" onclick=Connect()>Connect</button>
    <button type="button" onclick=GetBalance()>GetBalance</button>
    <div id="debug"></div>
    


    `

    Regards

  • thanks for reply @tarja , I will try to run this code, on my code return error it was displaying just object object.
  • I think It's not error that you're getting object. In debug console you get Json as object. you just need to parse that json object.

    Regards

  • I will give you feedback and thanks for your help bro!

Sign In or Register to comment.