Hi I am trying to modify "_ChartToolBar_Trading_" signal, and found in debug (as in picture) that TradeManager.TradingData.Positions.Items.Length = 0 even if I have position opened.
Also making trades does not trigger IPositions.Added() event.
I did not apply any restriction to AccountFltr, ProfileFltr or SymbolFltr. So any position is supposed to make the "Length" not equal to 0, right?
Please advise. Thanks.
TradeManager.TradingData.Positions.Items.Length = 0 even if
TradeManager.TradingData.Positions.Items.Length = 0 even if
- Attachments
-
- Image 6.png
- (111.71 KiB) Downloaded 1346 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: TradeManager.TradingData.Positions.Items.Length = 0 even
Hello gztanwei,
TradeManager receives the information regarding the orders from the Order and Position Tracker only after TradeManager.ProcessEvent() is called. Please make sure you have it in your code.
TradeManager receives the information regarding the orders from the Order and Position Tracker only after TradeManager.ProcessEvent() is called. Please make sure you have it in your code.
Re: TradeManager.TradingData.Positions.Items.Length = 0 even
Thanks. I called the TradeManager.ProcessEvents();. But the position still not showing up in TradeManager.TradingData.Positions.Items.Length.Hello gztanwei,
TradeManager receives the information regarding the orders from the Order and Position Tracker only after TradeManager.ProcessEvent() is called. Please make sure you have it in your code.
Could you further advise?
The broker profile is paper trading. Could it be the problem of paper trading code?
- Attachments
-
- Image 2.png
- (75.84 KiB) Downloaded 1327 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: TradeManager.TradingData.Positions.Items.Length = 0 even
Hello gztanwei,
Please export the study you are having issues with and send it to me for further analysis.
Please export the study you are having issues with and send it to me for further analysis.
-
- Posts: 22
- Joined: 01 Jun 2016
- Has thanked: 4 times
- Been thanked: 6 times
Re: TradeManager.TradingData.Positions.Items.Length = 0 even
gztanwei,
I don't know if your issue was resolved... I was having a similar issue, where my position would show-up with a delay.
Where you are calling the TradeManager.ProcessEvents() is critical. I was calling it at the end of the calcBar() method and IOG was disabled. So the bar would place an order at the and of the bar, but the position would not get updated until the next bar.
Now I call ProcessEvents in the void ResultCallback(IDataLoaderResult Result) method and I don't have this problem. I hope this helps. If you search for ResultCallback you will find examples on how to do that. I have an example in one of my other posts.
I hope this helps.
Erol
I don't know if your issue was resolved... I was having a similar issue, where my position would show-up with a delay.
Where you are calling the TradeManager.ProcessEvents() is critical. I was calling it at the end of the calcBar() method and IOG was disabled. So the bar would place an order at the and of the bar, but the position would not get updated until the next bar.
Now I call ProcessEvents in the void ResultCallback(IDataLoaderResult Result) method and I don't have this problem. I hope this helps. If you search for ResultCallback you will find examples on how to do that. I have an example in one of my other posts.
I hope this helps.
Erol