Edit on
<button type="button" class="btn btn-info" onclick='tradableEmbed.authenticateWithWindow()'>Enable trading</button>
<span id="result"></span>
body {
  font-size: 22px;
  background: #F0F0F0;
  margin: 20px;
}
$ = trEmbJQ; // Assign jQuery back to $

// Once trading enabled, updates happen every 700 millis by default
tradableEmbed.onAccountUpdated(function(snapshot){
    // Pretty print snapshot
    printResult(snapshot);
});

tradableEmbed.onEmbedReady(function () {
    if(tradableEmbed.tradingEnabled) {
        $(".btn").hide();
    }
});

function printResult(snapshot) {
    var preTag = "<pre class='prettyprint'>", preClose = "</pre>";
    $("#result").html(preTag + JSON.stringify(snapshot, null, 2) + preClose);
    PR.prettyPrint();
}
Rerun