def __init__(self,
                 distance,
                 timeInForce=OD.TimeInForce.GTC,
                 gtdTime=None,
                 clientExtensions=None):
        """Instantiate TrailingStopLossDetails.

        Parameters
        ----------

        distance : float or string (required)
            the price to trigger trailing stop loss order

        timeInForce : TimeInForce (required), default TimeInForce.GTC
            the time in force

        gtdTime : DateTime (optional)
            gtdTime is required in case timeInForce == TimeInForce.GTD

        clientExtensions : ClientExtensions (optional)


        Example
        -------

            >>> import json
            >>> from oandapyV20 import API
            >>> import oandapyV20.endpoints.orders as orders
            >>> from oandapyV20.contrib.requests import (
            >>>     MarketOrderRequest, TrailingStopLossDetails)
            >>>
            >>> accountID = "..."
            >>> client = API(access_token=...)
            >>> # at time of writing EUR_USD = 1.0740
            >>> # add a trailing stoploss, at 50 pips GoodTillCancel (default)
            >>> sld = 1.0740 - 1.0690
            >>> trailingStopLossOnFill = TrailingStopLossDetails(distance=sld)
            >>> print(trailingStopLossOnFill)
            {
                "timeInForce": "GTC",
                "distance": "0.00500"
            }
            >>> ordr = MarketOrderRequest(
            >>>     instrument="EUR_USD",
            >>>     units=10000,
            >>>     trailingStopLossOnFill=trailingStopLossOnFill.data
            >>> )
            >>> print(json.dumps(ordr.data, indent=4))
            >>> r = orders.OrderCreate(accountID, data=ordr.data)
            >>> rv = client.request(r)
            >>> ...
        """
        super(TrailingStopLossDetails, self).__init__(
            timeInForce=timeInForce,
            gtdTime=gtdTime,
            clientExtensions=clientExtensions)
        self._data.update({"distance": PriceValue(distance).value})
def __init__ ( self , distance , timeInForce = OD . TimeInForce . GTC , gtdTime = None , clientExtensions = None ) : super ( TrailingStopLossDetails , self ) . __init__ ( timeInForce = timeInForce , gtdTime = gtdTime , clientExtensions = clientExtensions ) self . _data . update ( { "distance" : PriceValue ( distance ) . value } )
Instantiate TrailingStopLossDetails.

        Parameters
        ----------

        distance : float or string (required)
            the price to trigger trailing stop loss order

        timeInForce : TimeInForce (required), default TimeInForce.GTC
            the time in force

        gtdTime : DateTime (optional)
            gtdTime is required in case timeInForce == TimeInForce.GTD

        clientExtensions : ClientExtensions (optional)


        Example
        -------

            >>> import json
            >>> from oandapyV20 import API
            >>> import oandapyV20.endpoints.orders as orders
            >>> from oandapyV20.contrib.requests import (
            >>>     MarketOrderRequest, TrailingStopLossDetails)
            >>>
            >>> accountID = "..."
            >>> client = API(access_token=...)
            >>> # at time of writing EUR_USD = 1.0740
            >>> # add a trailing stoploss, at 50 pips GoodTillCancel (default)
            >>> sld = 1.0740 - 1.0690
            >>> trailingStopLossOnFill = TrailingStopLossDetails(distance=sld)
            >>> print(trailingStopLossOnFill)
            {
                "timeInForce": "GTC",
                "distance": "0.00500"
            }
            >>> ordr = MarketOrderRequest(
            >>>     instrument="EUR_USD",
            >>>     units=10000,
            >>>     trailingStopLossOnFill=trailingStopLossOnFill.data
            >>> )
            >>> print(json.dumps(ordr.data, indent=4))
            >>> r = orders.OrderCreate(accountID, data=ordr.data)
            >>> rv = client.request(r)
            >>> ...