I am looking to compute the spread price between 2 instruments say ZN and XT. In my script I used the following to calculate the bid-ask for the spreads between these 2 instruments.
AskSpreadPx = GetCurrentAsk(0) - GetCurrentBid(1);
Current Ask Price of ZN - Current Bid Price of XT
BidSpreadPx = GetCurrentBid(0) - GetCurrentAsk(1);
Current Bid Price of ZN - Current Ask Price of XT
I am doing or interpreting the above correctly? I did a run of on my Interactive Brokers paper account and found that when I output the AskSpreadPx and BidSpreadPx, they are all the same. A further look reveals that GetCurrentAsk(0) is the same as GetCurrentBid(0) and GetCurrentBid(1) is GetCurrentAsk(1)?? Isn't this function support to get me the bid and ask for the respective instruments?
Appreciate yr help thanks.
EG
Comment