Login Page - Create Account

Support Board


Date/Time: Wed, 26 Jan 2022 05:35:29 +0000



CTS internal position data

View Count: 1579

[2013-05-13 15:53:22]
User35525 - Posts: 154
Dear SC,

I understand from this thread (http://www.sierrachart.com/SupportBoard.php?ThreadID=980) that sc.GetInternalPosition doesn't work with CTS. Does that mean sc.GetTradePosition also doesn't work? I was hoping to use it to get OpenProfitLoss and DailyProfitLoss. If that won't work, is it possible for SC to make methods to get OpenProfitLoss and DailyProfitLoss from the trade activity log?

Best Regards,
Ted
[2013-05-13 16:07:38]
Sierra Chart Engineering - Posts: 100044
This is an incorrect assumption .

sc.GetInternalPosition is equivalent to sc.GetTradePosition .

These work with all Trading services.

For some reason that user is getting some invalid fill prices. We're not sure why the T4 system is providing those values and it does concern us. We are working on an FIX connection the T4 system which is a much more solid method of integration for Sierra Chart. We would expect this problem to be resolved in that case. If there still is a problem it should be easy at that time to isolate the source of the issue.

The Daily Profit Loss is calculated from the Trade Activity Log data now.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2013-05-13 18:59:05]
User35525 - Posts: 154
I am using sc.GetTradePosition in a function that runs continuously to put the real-time nav (open profit and loss plus daily closed profit loss) on the screen. It runs on every chart, and each chart updates its own global variable. In this way I can know my real-time account balance at all times, and take action as-required.

sc.GetTradePosition updates my nav in real-time in simulation mode for FXCM symbols. It wasn't working for me this morning for CTS live trades. I'm now trading CTS in simulation mode to see if that works, which it probably will, since trading in FXCM simulation mode worked.

--Ted
[2013-05-15 12:15:28]
User35525 - Posts: 154
Dear SC,

Sim-trading is working but I'm still having trouble with CTS getting s_SCPositionData. Here is my use case: I'm using SC 971 and want to be out of the market at 3p.m. or if I'm losing too much money on the day, so have two studies.

One calculates on every tick and takes trades. The 2nd calculates continuously (sc.UpdateAlways = 1) because it needs to be out at 3p.m. and if my daily loss (open + closed profit) is too large. This latter study disables Autolooping (sc.AutoLoop = 0) because it's not filling any Subgraph[].Data[] arrays (this makes it run much faster too since I have several charts running the study). The documentation says another benefit to "sc.AutoLoop = 0" is that calls to sc.GetTradePosition will not produce an error. I'm also setting "sc.MaintainTradeStatisticsAndTradesData = 1" because I'm using s_SCPositionData.

If sc.GetTradePosition works with CTS, is the problem that I'm using a 2nd trade study on the same chart? The 2nd study calls "sc.GetTradePosition(PositionData)" and displays on-screen the chart's real-time nav, as well as global nav between all charts, then calls "sc.FlattenAndCancelAllOrders()" as-necessary. If trading is disabled, it sets a global variable so all trading studies know to not take trades until the next session. Everything works okay in sim-mode.

Best Regards,
Ted

Date Time Of Last Edit: 2013-05-15 12:30:00
[2013-05-15 20:47:28]
Sierra Chart Engineering - Posts: 100044
We are not sure what your question is. You need to understand that an advanced question like this is well outside the scope of our support. We do not have time to understand this.

We will make certain that the documentation for each member of the structure used by sc.GetTradePosition is accurately documented and contains links to the relevant documentation.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2013-05-15 20:55:17]
User35525 - Posts: 154
Thanks, I understand it's probably too complex to just talk about. I'll get together a minimal coded example with as few lines as possible to show the issue.

Best,
Ted
[2013-05-15 20:57:53]
Sierra Chart Engineering - Posts: 100044
We really do not have time for this. We are going to make sure the documentation is clear as to how the data in each of the structure members is arrived at. You will then have to look at the source data to understand the problem. That is all we can do. We cannot look at any source code or try to help you with your specific case. You will need to do that yourself.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2013-05-15 21:04:28]
User35525 - Posts: 154
I'm confused as to why sc.GetTradePosition works in my study for sim-trading, but not with CTS. I really need to know at all times what my aggregate nav is across all charts being traded.

I'll troubleshoot it some more, maybe some kind soul on this list uses CTS and GetTradePosition. I cannot trade my system live until I get this resolved.

--Ted
[2013-05-16 10:12:40]
User35525 - Posts: 154
I've figured this out. You can close trades for a chart in different studies, but there should be at most one study using internal position data and calling sc.GetTradePosition.
--Ted
[2013-05-16 21:06:09]
Sierra Chart Engineering - Posts: 100044
We still plan to get back to you on this, we just want to go over internally how all of this works and update our documentation. We will provide complete explanations with how the calculations are arrived at and then you can look at the underlying data in the Trade Activity Log.

The data for sc.GetTradePosition is symbol specific. So it applies to all charts for that symbol. There is also different sets of data for simulation and non-simulation mode.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2013-05-16 21:06:58

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account