Login Page - Create Account

Support Board


Date/Time: Tue, 07 May 2024 20:22:28 +0000



PLEASE HELP!... STOP ORDERS NOT WORKING PROPERLY

View Count: 2367

[2020-01-29 15:24:57]
rahul - Posts: 160
Hello, I am going to summarize all issues I am having with Live Trading using Stop Orders.
Please note that my code is working fine as the behavior in simulated trading when replaying charts works okay.

Logic:
(BAR_HAS_CLOSED == true)
{
sc.FlattenAndCancelAllOrders(); // Cancel all open orders, executed orders, attached orders and current positions

// Initiate new Buy Stop and Sell Stop orders simultaneously
}

Errors:
1. When bar has closed, and if there is a current positions open, then they get closed, but the new Buy Stop and Sell Stop orders don't execute. I can't even find an error in the activity log. However, if there are no currently open positions, then new Buy Stop and Sell Stop orders are executed.
In the attached excel file you will see at 19:30, the current open position was closed (row 140), but there is no error or trace of entering the buy stop and sell stop orders. Could the problem be that in simulated trading the flatten position is accepted instantly, but in live trading the response is not achieve till sometime passed? In that case, how I do stay in the loop till all positions closed and new stop orders are initiated?

2. My Buy stop was rejected, even though I had the following option checked "Auto-Send Market Orders on Rejected Stop Attached Order". Please refer to lines 70, 73 and 76 in the excel file. Even though I had the option checked, and the market (9118.50) was less than the buy stop (9118.75), the order was rejected.

3. In the instances where the buy stop and sell stop are executed, the Profit targets are correct in the activity log. However, on the chart, randomly the profit targets moves.
So if I enter a profit offset of 8 through ASCIL, the buy stop has profit target and sell stop have profit targets = 8 points way. But for some reason, on the chart either the buy stop or sell stop shifts to 2 points away i.e. treating the 8 in ticks (2 points).
Why is Price2 column being populated in Activity Log? I am not using Price2 at all. I am using Stop Order with Single Profit and Single Stop. I don't see Price2 getting populated in simulated trading? Does this have something to do with my issue listed above?

NONE OF THESE ISSUES SHOW UP IN SIMULATED TRADING, SO HOW AM I SUPPOSED TO DIAGNOSE AND FIX IT?
IT'S TOO COSTLY TO EXPERIENCE THESE ISSUES IN LIVE TRADING, AS I HAVE EXPERIENCED IT LAST NIGHT.
PLEASE HELP ME RESOLVE THIS.
Date Time Of Last Edit: 2020-01-29 15:42:05
Private File
[2020-01-30 02:58:26]
Sierra Chart Engineering - Posts: 104368
We need some time to go over this in particular item 3. But we see no reason why stop orders would make any difference.
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
[2020-01-30 04:44:08]
rahul - Posts: 160
thank you. I modified my code to make it completely unmanaged trading (see image attached) and testing "live" again, as I have no other option. But I still notice Price2 column getting populated. Not sure why this is happening.

Please also focus on points 1 and 2 above. There is something probably going on with the "flatten and cancel order" that doesn't enter new stop orders if there is a position open which needs to be flattened.

Another thing I noticed, which doesn't show up in simulated trading is the way the orders show up on the chart. In the image attached, I have a Buy stop at 9084.25 and profit at 9092.75. However in the Buy Stop I noticed (9090.25) in brackets...what is that? it also populates on Price2 column.
Date Time Of Last Edit: 2020-01-30 05:01:33
Private File
Private File
[2020-01-30 08:55:25]
rahul - Posts: 160
Quick update: Based on initial test in "live" trading, issue 1 seems to be resolved by changing to completely unmanaged trading options as listed in your documentation. Will keep you posted if this stops working as normal.

Open Issues:
1. My Buy stop was rejected, even though I had the following option checked "Auto-Send Market Orders on Rejected Stop Attached Order". Please refer to lines 70, 73 and 76 in the excel file. Even though I had the option checked, and the market (9118.50) was less than the buy stop (9118.75), the order was rejected.

2. Refer to the image in the post above for how the order is displaying on the chart, as the value in brackets shows up in Price2 column.
[2020-01-30 18:20:43]
Sierra_Chart Engineering - Posts: 14260
2. Refer to:
Order Types: Stop Orders on the CME
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2020-01-31 15:31:47]
rahul - Posts: 160
Thank you for the explanation for issue 2. Any possible way to understand how CME calculates it?

Any update on issue 1?
My Buy stop was rejected, even though I had the following option checked "Auto-Send Market Orders on Rejected Stop Attached Order". Please refer to lines 70, 73 and 76 in the excel file. Even though I had the option checked, and the market (9118.50) was less than the buy stop (9118.75), the order was rejected.
[2020-01-31 20:41:52]
rahul - Posts: 160
Hello again, I can confirm that issue 1 is NOT WORKING. I got another order rejected, even though I have "Auto-Send Market Orders on Rejected Stop Attached Order" option checked. Please check your code for this functionality.

I have attached a new trade log to show this. I this case the Sell Stop was at 8992, but the market was at 8991.25, so a Market Order should have been executed.
Private File
Private File
[2020-01-31 20:52:01]
Sierra_Chart Engineering - Posts: 14260
Regarding order with Internal Order ID: 7271, this is a parent order and will not have a replacement market order sent.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2020-01-31 20:52:51]
Sierra_Chart Engineering - Posts: 14260
Any possible way to understand how CME calculates it?
They should have this posted on their website somewhere.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2020-01-31 20:54:30]
Sierra_Chart Engineering - Posts: 14260
3. In the instances where the buy stop and sell stop are executed, the Profit targets are correct in the activity log. However, on the chart, randomly the profit targets moves.
So if I enter a profit offset of 8 through ASCIL, the buy stop has profit target and sell stop have profit targets = 8 points way. But for some reason, on the chart either the buy stop or sell stop shifts to 2 points away i.e. treating the 8 in ticks (2 points).
Do you still need us to look into this? But if the prices are correct in the Trade Activity Log, then there is not a problem to begin with.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2020-01-31 20:55:34
[2020-01-31 21:01:40]
rahul - Posts: 160
o you still need us to look into this? But if the prices are correct in the Trade Activity Log, then there is not a problem to begin with.
You can ignore this for now.

Regarding order with Internal Order ID: 7271, this is a parent order and will not have a replacement market order sent.

Okay, so can you please help me with sending a market order with profit and stops attached to it? The problem is the market moves faster than the code can react to it at times. That's why in my first post above, the fill didn't occur even though the stop was valid. In this example I agree, the price out outside the stop condition.

Any way for you to post a sample code to help me address this issue?

Also, I just ran a chart replay and the stop order went through, so I can't debug in testing either.
So this reflects my point that the market moves faster than the code can execute... so please help me with understanding how to send a market order with profit and stop attached in such a situation, when bar has closed. Thank you very much for your help in advance.
Date Time Of Last Edit: 2020-01-31 23:14:13
[2020-02-03 18:38:34]
Sierra_Chart Engineering - Posts: 14260
The file /ACS_Source/TradingSystem.cpp has many examples. The only difference is that you simply set the order type for the parent order like this:
NewOrder.OrderType = SCT_ORDERTYPE_MARKET;

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, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2020-02-03 18:39:42
[2020-02-05 04:01:44]
rahul - Posts: 160
Thank you. Market orders don't solve the purpose. I might have to to Market Order when Touched instead.

Also, regarding reply of chart. I get very different results when I reply chart at 30720 as compared to 30 times. What is the optimal speed to replay chart at when using "Accurate System Testing" method?
[2020-02-05 18:41:54]
Sierra_Chart Engineering - Posts: 14260
The speed should not matter in this case.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2020-10-05 20:21:33]
User103448 - Posts: 69
maybe im wrong in this topic, but it looks like similar to my issue.

Maybe you could tell me, why my stop was not triggered here?

best regards

Luigi
imageEU6.JPG / V - Attached On 2020-10-05 20:21:14 UTC - Size: 56.62 KB - 259 views
Attachment Deleted.
[2020-10-06 07:25:15]
Sierra Chart Engineering - Posts: 104368
This is totally impossible for us to answer questions like this. We cannot tell from a screenshot.

Assuming this is a simulated order, we can only refer you to:
Trade Simulation: How Orders are Filled
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
[2020-10-07 13:02:15]
User103448 - Posts: 69
How can you tell? Which information do you need?

Yes it is a simulated order, before switching to Sierra Chart i want to be sure everything is working reliable.

Does this only occur in simulated orders?

here another recent example


Best Regards

Luigi
imageOJ.JPG / V - Attached On 2020-10-07 13:01:45 UTC - Size: 185.54 KB - 250 views
[2020-10-07 22:08:04]
Sierra Chart Engineering - Posts: 104368
Are you able to consistently reproduce this?

Make sure the setting is set to about 5000:
Data/Trade Service Settings: Number of Stored Time and Sales Records (Global Settings >> Data/Trade Service Settings >> Common Settings >> Common Other Settings)
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
[2020-10-08 08:24:10]
User103448 - Posts: 69
I need to check this out. On the first thought, this started to happen when my CQG Data feed runned out and i had to renew service package and datafeed.
It looked like, that all orders placed within "old" datafeed abonnement didnt get executed. Is that possible at all?

The value you mentioned was set to 4000, i changed it to 10000 now, system memory looks fine now. Is 5000 enough?
[2020-10-08 09:12:09]
Sierra Chart Engineering - Posts: 104368
Not sure about the first question. We do not have enough understanding of the specifics in your case. But in general if you see the order on the chart, then it should be evaluated.

5000 is enough.
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
[2020-10-11 15:26:43]
User103448 - Posts: 69
Does the Software need to be open/running for execution?
[2020-10-12 21:31:20]
Sierra Chart Engineering - Posts: 104368
No unless it is a client-side managed order.

What is the specific order type you are referring to?
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
[2020-10-13 14:37:01]
User103448 - Posts: 69
Today order didnt get executed again. Maybe Im fundamentally wrong with something.
Its a buy stop order placed @111.025 before market opening. i used attached orders to directy place a stoploss @ 110.225.
Order has been placed via DOM. Datafeed is CQG

As you can see on the screenshot, market went down first to 110.800 and passed buy stop order without executing it.

For reference its F.US.GLEZ20 Contract on sim account.
imageGLnoFill.JPG / V - Attached On 2020-10-13 14:35:05 UTC - Size: 70.12 KB - 256 views
[2020-10-13 14:54:30]
rahul - Posts: 160
Did you place the buy stop order when the market was below 111.025? Also if there is a delay between when the order is placed and when its actually sent to the broker, that can cause a miss in entry.
To avoid this, check if order is open even after open < entry price and close > entry price...if it is, then execute a market order. This way incase the stop order is missed, you can still enter. Hope this makes sense.

Since I had started this thread, I had couple of missed orders myself... I used this as a workaround.
[2020-10-13 15:32:26]
User103448 - Posts: 69
According to trading log, price was at 111.000, when i placed the order. But market was closed. it was 1 hr before market opening.

Im not quite sure what you mean, could explain it another way ?

Thanks so far!
Date Time Of Last Edit: 2020-10-13 15:33:29

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

Login

Login Page - Create Account