Login Page - Create Account

Support Board


Date/Time: Sun, 28 Apr 2024 16:56:47 +0000



Post From: Study: Trading System Based on Alert Condition

[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