joshuaulrich / IBrokers

R API to Interactive Brokers Trader Workstation
65 stars 54 forks source link

Trailing stop order of IBrokers in R #23

Open eugenehsu9 opened 4 years ago

eugenehsu9 commented 4 years ago

Description

Here is a condition that I want place a TRAIL order with stop price is 43.41 and trailing Percent is 2%.

I use IBrokers.zip of joshuaulrich from github.

However, when I place TRAIL order with trailing Percent, the order is not contained with trailing Percent.

Expected behavior

image

Minimal, reproducible example

twsOrder(action = "SELL", totalQuantity = 399, orderType = "TRAIL",trailingPercent = "2", tif = "GTC", transmit = FALSE, trailStopPrice = 43.41)

Session Info

[Insert your sessionInfo() output]