How to Add standard orders with different parameters

Below are the examples for different AddOrder calls: 

Add a standard order: sell 1.123 XBT/USD @ limit $120

$res = $kraken->QueryPrivate('AddOrder', array(
    'pair' => 'XXBTZUSD',
    'type' => 'sell',
    'ordertype' => 'limit',
    'price' => '120',
    'volume' => '1.123'
));
print_r($res);


Example output:

Array
(
    [error] => Array
        (
        )
    [result] => Array
        (
            [descr] => Array
                (
                    [order] => sell 1.12300000 XBTUSD @ limit 120.00000
                )
            [txid] => Array
                (
                    [0] => OAVY7T-MV5VK-KHDF5X
                )
        )
)


Add a standard order: buy €300 worth of XBT at market at 2013-08-12T09:27:22+0000

$res = $kraken->QueryPrivate('AddOrder', array(
    'pair' => 'XXBTZEUR',
    'type' => 'buy',
    'ordertype' => 'market',
    'oflags' => 'viqc',
    'volume' => '300',
    'starttm' => '1376299642'
));
print_r($res);


Example output:

Array
(
    [error] => Array
        (
        )

    [result] => Array
        (
            [descr] => Array
                (
                    [order] => buy 300.00000000 XBTEUR @ market
                )

            [txid] => Array
                (
                    [0] => ONQN65-L2GNR-HWJLF5
                )
        )
)


Add a standard order: buy 2.12345678 XBTUSD @ limit $101.9901 with 2:1 leverage, with a follow up stop loss, take profit sell order: stop at -5% loss, take profit at +$10 price increase (signed stop/loss prices determined automatically using # notation):

$res = $kraken->QueryPrivate('AddOrder', array(
    'pair' => 'XXBTZUSD',
    'type' => 'buy',
    'ordertype' => 'limit',
    'price' => '101.9901',
    'volume' => '2.12345678',
    'leverage' => '2:1',
    'close' => array(
        'ordertype' => 'stop-loss-profit',
        'price' => '#5%',  // stop loss price (relative percentage delta)
        'price2' => '#10'  // take profit price (relative delta)
    )
));
print_r($res);


Example output:

Array
(
    [error] => Array
        (
        )
    [result] => Array
        (
            [descr] => Array
                (
                    [order] => buy 2.12345678 XBTUSD @ limit 101.99010 with 2:1 leverage
                    [close] => close position @ stop loss -5.0000%, take profit +10.00000
                )
            [txid] => Array
                (
                    [0] => OFMYYE-POAPQ-63IMWL
                )
        )
)

See our API documentation for more about the "AddOrder" call :

https://www.kraken.com/help/api#add-standard-order