@orenshkol said in Running multiple symbols data feeds in live IB:
So I set qcheck = 0.001 which does synchronizes the datas when they are all available, which seems to be the best solution
The problem (or back side) of such qcheck setting is a high CPU load during live trading. See my previous post about it (https://community.backtrader.com/topic/2346/high-cpu-load-during-pre-market-live-trading-and-adaptive-qcheck-logic).
Share the script please. It is not clear what do you try to achieve.
notify_order() is called than your orders are processing, but looks that you don't have them yet. So it should not be called at all.
@backtrader thank you for the guidance. I read the documentation but I struggle to implement it.
Why it seems pointless and illogical? In fact many brokers give you a choice what to include in the bracket order (stop only, limit only, or stop/limit). What is wrong in having a stop to prevent you from excessive loss while working your own logic about the closing conditions.
@backtrader OK thanks for response :) It has nothing to do with me expecting an AI to have belief in other AI entities or any of whatever you're trying to imply.
It has to do with the simple expectation--of a framework--that a BUY order executed for a given symbol will have a position size reflected in any query on that same symbol, regardless of whatever timeframe the orders or queries are being executed on. It is counter-intuitive to operate in any other way.
I will work around that, and I will see what Alpaca has to say and post back here if its relevant. Cheers!
The resampler filter wouldn't know what to do with extra lines (add, max, min, sub, multiply, take the 3rd one, take the last ...) and works only with the fields for which it has a rule, the standard ones.
You can create a 2nd data feed, assign your desired fields to open (keep 1st), high/low (keep max/min), close (keep last), volume (add) and use that resampled to match the timeframe of your master data feed.
Or create your own resampling filter.
After further check - it seems the problem was caused by my own changes. The warning messages were pushed by mistake to the same message queue that was used by 'reqContractDetails'.
My apologies. Please ignore this topic.
Thank you for your answer.
I am used to MT4. The operation habit of order affects my understanding.
After understanding, I can think of an application: Calculate used margin
if order.status in [order.Completed]:
for bit in order.executed.exbits:
self.marginUsed += bit.openedvalue - bit.closedvalue
If this is not right, please give me suggestions and thank you again for your reply
@Ross-Coates said in TypeError: __init__() got an unexpected keyword argument 'size':
In any case let me point out that those three ticks (i.e ' vertical) are not backticks as in `
You may want to directly copy the ticks from the announcement at the top of the forum
For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Just enumerate through the datas in a pythonic way by referencing d. if len(d) > self.lenofdata....
If you reference self.datas you'll only ever access self.datas. Each timeframe and datafeed will have its own data in datas. datas datas datas... datas[n]. Also self.len has the potential for a keyword conflict. I suggest following backtraders example above.
Have you reviewed the multiple datas example? You might want to search that out.