(login for full post details)
#4 (permalink )
Ostrava, Czech Republic
Posts: 98 since May 2013
Thanks: 18 given,
38
received
I tried to send execution price via email alert but I get zero values in email for both variables (sc.GraphName and quantity) and dunno why. Can you have a look at the code? Thx
Code
// Set default position size
int quantity = 1;
// Create new market order object
s_SCNewOrder NewOrderLong;
NewOrderLong.OrderType = SCT_MARKET;
NewOrderLong.OrderQuantity = quantity;
// Send order and get result
OrderResult = sc.BuyEntry(NewOrderLong);
if (OrderResult > 0) {
// Get actual position data
s_SCPositionData InternalPositionDataOnEntry;
sc.GetTradePosition(InternalPositionDataOnEntry) ;
// Send alert by e-mail
SCString alertMessage;
sc.FormatString(alertMessage, "%s -> %d(at)%f", sc.GraphName, quantity, InternalPositionDataOnEntry.AveragePrice);
sc.SetAlert(1, alertMessage);
}