fork download
  1. <?php
  2.  
  3. $post_data = array (
  4. 'tradeOrder' => array (
  5. 'FirstOrder' => array (
  6. 'Legs' => array (
  7. 'Id' => '0',
  8. 'SecurityId' => '643',
  9. 'SecurityName' => 'AAPL',
  10. 'SecurityExchange' => 'NASDAQ national market',
  11. 'Side' => 'Buy',
  12. 'Quantity' => '100'
  13. ),
  14. 'SymbolLastPrice' => '93.72',
  15. 'Price' => '93.75',
  16. 'StopPrice' => '0.01',
  17. 'Type' => 'Limit',
  18. 'TimeInForce' => 'Day',
  19. 'AllOrNone' => 'false',
  20. 'Exchange' => 'AUTO',
  21. 'TrailingAmount' => '0.01',
  22. 'TrailingAmountType' => 'Absolute',
  23. 'LimitOffset' => '0',
  24. 'LimitOffsetType' => 'Absolute',
  25. 'IsTrailingVisible' => 'false',
  26. 'IsLimitOffsetVisible' => 'false',
  27. 'IsTrailingAmountAbsolute' => 'true',
  28. 'IsLimitOffsetAbsolute' => 'true',
  29. 'ExecutionTarget' => 'New',
  30. ),
  31. 'AdvancedOrderType' => 'Simple',
  32. 'IsAdvancedOrder' => 'false'
  33. )
  34. );
  35.  
  36. echo json_encode($post_data, JSON_PRETTY_PRINT);
  37.  
Success #stdin #stdout 0.04s 52480KB
stdin
Standard input is empty
stdout
{
    "tradeOrder": {
        "FirstOrder": {
            "Legs": {
                "Id": "0",
                "SecurityId": "643",
                "SecurityName": "AAPL",
                "SecurityExchange": "NASDAQ national market",
                "Side": "Buy",
                "Quantity": "100"
            },
            "SymbolLastPrice": "93.72",
            "Price": "93.75",
            "StopPrice": "0.01",
            "Type": "Limit",
            "TimeInForce": "Day",
            "AllOrNone": "false",
            "Exchange": "AUTO",
            "TrailingAmount": "0.01",
            "TrailingAmountType": "Absolute",
            "LimitOffset": "0",
            "LimitOffsetType": "Absolute",
            "IsTrailingVisible": "false",
            "IsLimitOffsetVisible": "false",
            "IsTrailingAmountAbsolute": "true",
            "IsLimitOffsetAbsolute": "true",
            "ExecutionTarget": "New"
        },
        "AdvancedOrderType": "Simple",
        "IsAdvancedOrder": "false"
    }
}