You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, the order arrived with limit price of -0.1, so there was a rounding from -0.12 to -0.1.
The rounding was not made by LEAN as we observe when we run a backtest with this code, so the NormalizePriceToBrokerage method rounded it down.
This method uses the GetMinTick method to look for the minimum price variation in the Contract. This information comes from Interactive Brokers. We should log both when NormalizePriceToBrokerage, and GetMinTick value.
If the minimum value is 0.05 for SPXW under $3, their API has a bug.
Checklist
I have completely filled out this template
I have confirmed that this issue exists on the current master branch
I have confirmed that this is not a duplicate issue by searching issues
I have provided detailed steps to reproduce the issue
The text was updated successfully, but these errors were encountered:
Expected Behavior
Receive a message when the
NormalizePriceToBrokerage
method changes the price.Actual Behavior
We are not notified about the change.
Potential Solution
Implement the same logic from Lean.
Reproducing the Problem
User algorithm placed the following trades:
Buy Leg: SPXW 240401P05150000, Strike: 5150.0, Bid: 0.0, Ask: 0.05, Last Price: 0.05
Sell Leg: SPXW 240401P05200000, Strike: 5200.0, Bid: 0.1, Ask: 0.2, Last Price: 0.1
Quantity: 1
Limit Price: -0.12
Time: 20240401 14:11:00.672 UTC
Reproduceable by the following algorithm:
However, the order arrived with limit price of -0.1, so there was a rounding from -0.12 to -0.1.
The rounding was not made by LEAN as we observe when we run a backtest with this code, so the
NormalizePriceToBrokerage
method rounded it down.This method uses the
GetMinTick
method to look for the minimum price variation in theContract
. This information comes from Interactive Brokers. We should log both whenNormalizePriceToBrokerage
, andGetMinTick
value.If the minimum value is 0.05 for SPXW under $3, their API has a bug.
Checklist
master
branchThe text was updated successfully, but these errors were encountered: