Login Page - Create Account

Support Board


Date/Time: Wed, 24 Apr 2024 08:56:47 +0000



Exit signal

View Count: 3397

[2013-08-06 14:16:59]
kirstenjd - Posts: 34
I am using SC auto-trading (Defaultworksheet) to enter and exit trades in IB.
Sometimes my exit signal gets sent to IB a second time (as the condition to exit fluctuate between being TRUE/FALSE/TRUE/FALSE), before the trade shows as closed in cell J8, and this has the result that a position is then opened wrongfully.
Is there a way or formula I can use to prevent this?
If the exit condition becomes true once, how can I retain that condition in that cell?

[2013-08-06 18:22:56]
Sierra Chart Engineering - Posts: 104368
When using Buy/Sell Exit Order Action columns on the Spreadsheet, another exit order is definitely not going to be allowed if the total quantity of the working orders which will exit the position equals or exceeds your current Position quantity.

One question is what column in the Spreadsheet are using to exit the position? And is the quantity of the exit order less than your position?

There may be something more going on than you are aware of. We recommend looking at the Trade >> Trade Activity Log for details of what your automated trading system is doing.
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-08-06 20:35:16
[2013-08-06 20:28:35]
kirstenjd - Posts: 34
Yes. I am using the Buy Exit Order Action columns on the Spreadsheet to exit the long position.
The quantity of the exit order is exactly equal to the position and the Long position gets flattened, but almost immediately a Short position is opened (quantity is equal to the above mentioned quantity.
I looked at the Trade Activity Log and saw these orders and the fills, but from that I can't make out how or why this happened.
I suspect that the exit signal became True (and an Exit signal was sent to IB)and between when the exit signal was sent and confirmation of flattening the trade was received, this True condition fluctuated between True and False and True again. This resulted that a second Exit signal landed at IB because SC has not received the signal back to change cell J8 to zero (the formula of my exit signal uses J8 to determine whether IB is in or out of a trade).
Is it possible that this has happened as I described or do you still think that something more is going on than what I am aware of? It is very important for me to understand why this has happened.
If the exit condition becomes true once, is there a way to retain that condition in that cell?
[2013-08-06 20:34:34]
Sierra Chart Engineering - Posts: 104368
This definitely could not be the case for the reasons given in the Automated trading documentation (read it again) and as we explained in the prior post:
and between when the exit signal was sent and confirmation of flattening the trade was received, this True condition fluctuated between True and False and True again. This resulted that a second Exit signal landed at IB because SC has not received the signal back to change cell J8 to zero (the formula of my exit signal uses J8 to determine whether IB is in or out of a trade).

If this is actually true, then something is wrong and it needs to be corrected but we have no evidence of that at this point.

Look at the Trade Activity Log, look at the Order Action Source for the order that established the new position. The particular spreadsheet column that triggered the order will be given. Is it one of the Exit columns? We would think not.
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-08-06 20:37:16
[2013-08-07 09:01:02]
kirstenjd - Posts: 34
I had a better look at the Trade Activity Log. Thank you for repeatedly telling me to have a better look at it.
Attached please find the Trade Activity Log.
At 2013/08/06 08:14:59 a Buy Exit Order (internal order number 1968 quantity 511000) was generated by DefaultWorksheetStudy and this order was filled at 08:15:01 (internal order number 1968 quantity 511000).
At 08:15:01 a second Buy Exit Order (internal order number 1969 quantity 511000) was generated by DefaultWorksheetStudy and this order was filled at 08:15:01 (internal order number 1969 quantity 511000). This second Buy Exit Order was generated before order number 1968 was filled - see attached Trade Activity Log.
This order (number 1969) and its fill now resulted in a "new" short position of 511000 and I had to flatten this manually.
The way I interpret this is that a Buy Exit Order was generated just before bar close (14:59) and before the fill signal was received, a second Buy Exit Order was generated just after the next bar opened 15:01). Both orders were then filled.
How do you read this?
If this is what happened, how can I prevent this in the future? This has happened a few times and I had to Flatten manually.

attachmentTradeActivityLog.xlsx - Attached On 2013-08-07 09:00:21 UTC - Size: 27.28 KB - 593 views
[2013-08-07 09:38:41]
Sierra Chart Engineering - Posts: 104368
For now set CancelAllWorkingOrdersOnExit to No, if you can.

Since this has been set to Yes, it is assumed that the outstanding orders will be canceled and therefore your position is not going to get flattened by one of those orders. It is not realistic that a market order will be able to be canceled. So this is confusing the logic. We will have a solution in the next few days.
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-08-07 10:01:32]
kirstenjd - Posts: 34
I have set CancelAllWorkingOrdersOnExit to No and will wait for you to let me know when you have a solution.
[2013-08-08 08:21:13]
kirstenjd - Posts: 34
After setting CancelAllWorkingOrdersOnExit to No (as you recommended), my auto-trades did not exit, using the formulas I normally used (while CancelAllWorkingOrdersOnExit was set on Yes).
I had to change this back to Yes for my Exits to work.
I will have to keep CancelAllWorkingOrdersOnExit on Yes until I hear back from you.

[2013-08-10 01:48:36]
Sierra Chart Engineering - Posts: 104368
Yes, we fully understand. That is why we said to disable it only if you can.

We have implemented the necessary changes. Please update to version 1007.
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-08-11 14:45:43]
kirstenjd - Posts: 34
Thank you for implementing the new changes.
I updated to version 1007, but had to downgrade to my previous version because of the following problem:
After opening SC a window opens "Accept Incoming Connection Attempt : Yes/No" where I normally click on Yes to connect to IB TWS. When I click on Yes, it attempts to connect but is unsuccessful and the window just appears again and again after clicking on Yes repeatedly.
I checked all my IB TWS settings, but everything seems to be OK. I did not change any of my settings before going the upgrade.
After downgrading to SC924 everything worked normally and I could accept the incoming connection attempt successfully by clicking on Yes.
[2013-08-13 05:22:28]
kirstenjd - Posts: 34
I hope you have not missed my most recent post.
[2013-08-13 05:51:11]
Sierra Chart Engineering - Posts: 104368
We did see it but for some reason we did not post a reply. You need to update to 9392 of Interactive Brokers TWS or higher in order to connect on the newer versions of Sierra Chart. You can download it from here:
https://download2.interactivebrokers.com/download/tws40_upgrade_latest.exe
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-08-13 05:51:28
[2013-08-16 11:21:11]
kirstenjd - Posts: 34
I updated to IB TWS 9393 and the "Accept Incoming Connection" issue is resolved. Thank you.
However.
I had to upgrade to SC 1011 as you recommended (see above), but now I am experiencing the following problems I did not have while using SC 924:
1.)In DefaultWorkSheet, Cell J47 shows Trade Service Account Balance of 0. In SC 924 Cell 924 showed my Account Balance correctly. How do I get this to update my account balance? (I need this to calculate my order quantity for the auto-trader).
2.)I see that there is a Study "Account Balance Text - External Service" and I added that to my Chart. There the Balance is also showing 0 on my Chart as well as in DefaultWorkSheet. How do I get that to work? I could not find any documentation on that Study?
3.)In my Orders & Positions Window >> Balance >> Current Cash Balance - the balance is not showing the correct amount (slightly of by $ 1775 to my cash balance in IB and I am currently in no trades). In SC 924 my balance at IB showed correctly.
[2013-08-16 13:49:56]
kirstenjd - Posts: 34
Please see my Post 16.
I have just downgraded SC 1011 to SC 924 and the 3 above mentioned problems do no exist on the older SC 924 running with the new updated IB TWS 9393.
I then seems that the problem is with SC 1011.
[2013-08-16 20:49:17]
Sierra Chart Engineering - Posts: 104368
1. The account balance displays correctly for us on the Spreadsheet. How many accounts do you see listed on the Trade >> Trade Orders and Positions >> Balance tab.

You also need to make sure you have the correct Trade Account selected:
http://www.sierrachart.com/index.php?l=doc/doc_TradeWindow.html#SelectingTradeAccount

2. We will add documentation for this study.

3. We have an idea why this is happening and it will be resolved. It is not updating automatically.

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-08-19 09:53:31]
kirstenjd - Posts: 34
I had to downgrade to SC 924 again because my account balance is not updating (as you mentioned), because I use the balance to auto-calculate my order quantity for the auto-trader.
How will I know when you have resolved this?
[2013-08-19 10:01:37]
Sierra Chart Engineering - Posts: 104368
The account balance issue has been resolved in the latest prerelease.

Update with Help >> Download Prerelease when you can.
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-08-19 10:01:58
[2013-08-20 04:15:32]
kirstenjd - Posts: 34
The account balance as well as the study "Account Balance" is working fine after I upgraded to the latest prerelease.
A new problem popped up with the new update that worked fine on SC 924.
I run 4 instances of SC on the same computer on the same IB account (sometimes on the same market).
When a trade executes in a instance of Sc, the trade "shows" on the other instances that are trading the same market. The position is also showing in both DefaultWorksheets. Will this mean I will not be able to enter a trade on the instance where there is supposed to be no trade going.
The instance ID of the 2 Instances is not the same. This is what you previously recommended to use for this not to happen. I am not sure if the exit signals of the one SC will also influance the other instance.
Please help. I am trading with real money. I have been upgrading and downgrading a few times the previous week.
[2013-08-20 05:08:49]
Sierra Chart Engineering - Posts: 104368
The only possibility is to use the Order Fill Calculated Position in the charts containing the trading systems. Here is the documentation for this:
https://www.sierrachart.com/index.php?l=doc/doc_TradeStatusWindows.html#UsingIndependentInternalPositions

The best solution is to use 2 separate trade accounts.
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-08-20 08:45:29]
kirstenjd - Posts: 34
I have implemented the UsingIndependentInternalPositions.

I already trade in 3 IB accounts and I am subscribed to 3 SC's, running 4 instances of SC on every IB account. It is just not practical to open a IB account for every trade.

Is the Instance Client ID number(Trade Service >> Instance Client ID), we used on the older SC's to keep the trades and orders for every Instance of SC separate, then still needed? Will it be too complicated to explain why this option is no longer educate for this function?

Please explain what will happen if the Internal Positions in SC for some reason differs from the real positions in IB? Will I be sitting on open positions in IB without SC flattening ALL the open positions in IB?
[2013-08-21 01:56:24]
kirstenjd - Posts: 34
I hope you have not missed my most recent post.
[2013-08-21 02:59:31]
Sierra Chart Engineering - Posts: 104368
Is the Instance Client ID number(Trade Service >> Instance Client ID), we used on the older SC's to keep the trades and orders for every Instance of SC separate, then still needed?
Yes.

There is the potential that the Order Fill Calculated Position may not match your actual position. You need to periodically verify that it is correct.
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

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

Login

Login Page - Create Account