可以分为三个步骤:
第一步:先做好挂单的模块
多挂单:
int DoBuySTOP(double a_lots_0, double ad_8, double ad_16, string a_comment_24) {
int li_36 = 1;
int l_ticket_40 = OrderSend(Symbol(), OP_BUYSTOP, a_lots_0, NormalizeDouble(ad_8, Digits), 3, 0, NormalizeDouble(ad_16, Digits), a_comment_24, -2101841039, 0, Red);
if (l_ticket_40 <= 0) Print("多单挂单失败:", GetLastErrorStr(), " price:", ad_8, " takeProfit:", ad_16, " Ask:", Ask, " Bid:", Bid);
while (li_36 < 10 && l_ticket_40 <= 0) {
RefreshRates();
l_ticket_40 = OrderSend(Symbol(), OP_BUYLIMIT, a_lots_0, NormalizeDouble(ad_8, Digits), 3, 0, NormalizeDouble(ad_16, Digits), a_comment_24, -2101841039, 0, Red);
if (l_ticket_40 <= 0) Print("多单挂单失败:", GetLastErrorStr(), " price:", ad_8, " takeProfit:", ad_1