Login Page - Create Account

Support Board


Date/Time: Fri, 29 Mar 2024 01:15:53 +0000



Study: Trading System Based on Alert Condition

View Count: 1241

[2018-05-17 13:39:39]
rahul - Posts: 160
Regarding the "Trading System Based on Alert Condition" study, what happens when I currently have no Buy Entry order but the system alert triggers as Buy Exit order. Does the software know NOT to go Short instead?

The reason I am asking is that if I run my study that shows theses alerts after market open I might have missed the Buy Entry order but my study assumes I am in the trade so the alert triggers a Sell Exit order.

How do I check if I currently have any open orders through code so that I don't enable a Buy Exit or Sell Exit system by mistake?

Can I do this to avoid going Short (if Buy Exit Order triggered through Study), without having any long positions on:

s_SCPositionData PositionData;
int Result = sc.GetTradePosition(PositionData);
int Quantity = PositionData.PositionQuantity;


if (Result == 1)
if (Quantity == 0)
// Don't trigger alert within my code
else if Quantity > 0
// Trigger Buy Exit
else if Quantity < 0
// Trigger Sell Exit

else
// Don't trigger alert within my code



Also, to avoid confusion (translating Sierra Chart terminology to my thinking). Is this right?
Buy Entry = Buy To Open
Buy Exit = Sell To Close
Sell Entry = Sell To Open
Sell Exit = Buy To Close
Date Time Of Last Edit: 2018-05-17 13:40:08
[2018-05-17 18:57:57]
Sierra Chart Engineering - Posts: 104368
Does the software know NOT to go Short instead?
Yes. Refer to:
Automated Trading Management: Buy Exit


The reason I am asking is that if I run my study that shows theses alerts after market open I might have missed the Buy Entry order but my study assumes I am in the trade so the alert triggers a Sell Exit order.

You will certainly see the signal on the chart graphically, but there could not possibly be an actual sell exit order under this condition.

Yes your code looks fine.
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
[2019-11-07 02:15:39]
j4ytr4der_ - Posts: 910
I'm exploring automatic trading now myself and just had the same question about exits triggering just because they are displayed on the chart.

My question now is, is there a way to have the entry or exit signals displayed on the chart *only* if there is (in the case of an exit) or is not (in the case of an entry) an existing matching trade open? Meaning a new buy entry signal will not display if currently in a long, and a new buy exit signal will not display if not currently in a long. And of course the inverse for shorts.

Any way to accomplish this?
[2019-11-08 01:38:44]
Sierra Chart Engineering - Posts: 104368
You just need to rely on the order fills which you can display on the chart:
Chart Trading and the Chart DOM: Displaying Order Fills on the Chart
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
[2019-11-08 03:02:18]
j4ytr4der_ - Posts: 910
Yes I already have those turned on. So I guess you're saying to set the signals themselves to hidden and just rely on the order fills. I suppose that would work. Thanks.

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

Login

Login Page - Create Account