Re: using reqAccountUpdates to create pandas dataframe for each new update
A quick observation tells me that certain items are faint because they are not called up later in the code.
By
Trevor McPherson
·
#47306
·
|
Re: using reqAccountUpdates to create pandas dataframe for each new update
def updatePortfolio (self,
contract: Contract ,
position: float ,
marketPrice: float ,
marketValue: float ,
averageCost: float ,
unrealizedPNL: float ,
By
@ScottBrian
·
#47305
·
|
Re: using reqAccountUpdates to create pandas dataframe for each new update
Thanks Kevin, I will give that a try.
By
@ScottBrian
·
#47304
·
|
Re: using reqAccountUpdates to create pandas dataframe for each new update
Change the default PyCharm colour scheme?
I use the Intelli Light scheme in PyCharm, and just copied and pasted into a new .py document. Readibility is good.
KH
def updatePortfolio (self,
By
Kevin
·
#47303
·
|
Re: using reqAccountUpdates to create pandas dataframe for each new update
Sorry, I notice I can't see the code I posted very well. Some of the
code elements seem to show up so lightly that I can't see them.
If I drag my cursor across it to select it, then I can read
By
@ScottBrian
·
#47301
·
|
Re: using reqAccountUpdates to create pandas dataframe for each new update
In your class __init__, add:
self.positions = pd.DataFrame()
in def updatePortfolio, try this:
def updatePortfolio ( self ,
contract : Contract ,
position : float ,
marketPrice:
By
@ScottBrian
·
#47300
·
|
Re: Does anyone here track fills on touch in their systems for futures?
Yes, assuming it's not a popular price. If it's something commonly followed like previous high/low/close there might be a bunch of orders there already.
By
Nick <news1000@...>
·
#47299
·
|
Re: Does anyone here track fills on touch in their systems for futures?
So, putting in the sell limit order at 4000 really early would increase your chance of actually getting triggered I assume? My open buy/sell limit always has an attached bracket order, all of them
By
Raoul Suurmeijer
·
#47298
·
|
Time held for each positions
Is there a way to pull the time held for each position? For example, I want to buy a stock, hold it for 100 minutes, and then sell it.
Other than manually adding a counter to each symbol after each
By
dvc2929@...
·
#47297
·
|
using reqAccountUpdates to create pandas dataframe for each new update
Is there a way of using reqAccountUpdates and updatePortfolio to create a dataframe with all positions, and then overwrite the dataframe for each refresh?
I am using reqAccountUpdates so that I can
By
dvc2929@...
·
#47296
·
|
Re: Does anyone here track fills on touch in their systems for futures?
I haven't traded e-mini's for a while but there used to be thousands of contracts at each price near the current price. When you place a limit order you go to the back of the line for that price, so
By
Nick <news1000@...>
·
#47295
·
|
Does anyone here track fills on touch in their systems for futures?
Hey guys I'm about to run through a ton of trades by hand to check if the fills would have filled.. For example, I want to sell 1 E-Mini contract at 4000 and the high of the current candle is 4000.
By
Patrick C
·
#47294
·
|
Re: ticks never received after requesting market data
Natan
Sorry to nit-pick, but I think it's a little misleading to say that 'the API allows for a hang': that makes it sound like the API is at fault and should be doing something different.
By
Richard L King
·
#47293
·
|
Re: ticks never received after requesting market data
Hi
Since it's a scanner, and if you don't need a model price of an option, you
can look at reqHistoricalData(1, DAY, 15minutes bars, trades, RTH=true)
By
Artyom T.
·
#47292
·
|
Re: ticks never received after requesting market data
Thanks for your responses, guys.
My script is not a live trading tool but rather a scanner that generates a list of candidates for me.
It uses Frozen data types because I mostly work on it after
By
nsh2tman
·
#47291
·
|
Re: ticks never received after requesting market data
Hi
comments inline
Artyom
Consider going fully async / concurrent. Call cancelMktData only when you
received enough data for your
By
Artyom T.
·
#47290
·
|
Re: ticks never received after requesting market data
If the data is not in TWS it would be unlikely to be in the API.
You can't force the API to work the way you want so you have to adapt to whatever (possibly wacky) things it does. In this case you
By
Nick <news1000@...>
·
#47289
·
|
ticks never received after requesting market data
Hi everyone,
My python script is looping through a list of option tickers (calls and puts with specific strike and expiration).
For each of them, I am sending reqMktData. I do it one at a time: I
By
nsh2tman
·
#47288
·
|
Swift + TWS
Hello,
I am a Swift developer and I am beginning to trade programatically. Does anyone do their trading using Swift? I see I can use most of the rest and web socket end points to get everything
By
KyleITM
·
#47287
·
|
Re: the fields commission, max/min Commission in openOrder state are broken
why do you think its wrong? In the first case it lists commissions in the range [0.17, 0.75], in the second case it shows commissions as 2.0. Have you tried the Preview Order button in TWS? It should
By
Josh
·
#47286
·
|