- [Phemex Create Order Position With Takeprofit Stoploss](./examples/php/) ```php 'YOUR_API_KEY', 'secret' => 'YOUR_API_SECRET', )); $symbol = 'XRP/USDT:USDT'; $side = 'buy'; // set it to 'buy' for a long position, 'sell' for a short position $order_type = 'limit'; // set it to 'market' or 'limit' $amount = 1; // how many contracts $price = 0.5; // set a price at your desired level // take profit and stop loss prices and types $take_profit_trigger_price = 0.6; $stop_loss_trigger_price = 0.4; $take_profit_limit_price = 0.7; $stop_loss_limit_price = 0.3; Async\await($exchange->load_markets()); // when symbol's price reaches your predefined "trigger price", stop-loss order would be activated as a "market order". but if you want it to be activated as a "limit order", then set a 'price' parameter for it $params = array( 'posSide' => 'Long', 'stopLoss' => array( 'triggerPrice' => $stop_loss_trigger_price, 'type' => 'limit', 'price' => $stop_loss_limit_price, ), 'takeProfit' => array( 'triggerPrice' => $take_profit_trigger_price, 'type' => 'limit', 'price' => $take_profit_limit_price, ), ); var_dump('-----------------------------------------------------------------------'); try { $created_order = Async\await($exchange->create_order($symbol, $order_type, $side, $amount, $price, $params)); var_dump('Created an order', $created_order); // Fetch all your open orders for this symbol $all_open_orders = Async\await($exchange->fetch_open_orders($symbol)); var_dump('Fetched all your orders for this symbol', $all_open_orders); } catch(Exception $e) { var_dump(((string) $e)); } }) (); } Async\await(example()); ```