Здравствуйте, подскажите плз как снять все активные тейк-профит? Приведенная функция не работает, хотя тейк-профит в стоп заявках вроде.
---------
' =========== УДАЛЯЕМ СТОП-ЗАЯВКИ
FUNC KILLALLSTOPORDERS(KEY)
MESSAGE ("СНИМАЕМ "&KEY,1)
N=GET_NUMBER_OF("STOP_ORDERS")
IF N>0
FOR I FROM 0 TO N
IF (GET_VALUE (GET_ITEM ("STOP_ORDERS", I), "STATUS")="ACTIVE") AND (GET_VALUE (GET_ITEM ("STOP_ORDERS", I), "SECCODE")=INSTRUMENT)
NEW_GLOBAL("TRANS_PARAMS", "")
NEW_GLOBAL("TRANS_RESULT", "")
TRANS_PARAMS = ""
TRANS_PARAMS = SET_VALUE (TRANS_PARAMS, "TRANS_ID", "7"&TIME)
TRANS_PARAMS = SET_VALUE (TRANS_PARAMS, "CLASSCODE", "SPBFUT")
TRANS_PARAMS = SET_VALUE (TRANS_PARAMS, "SECCODE", KEY)
TRANS_PARAMS = SET_VALUE (TRANS_PARAMS, "ORDER_KEY", GET_VALUE (GET_ITEM ("STOP_ORDERS", I), "NUMBER")&"")
TRANS_PARAMS = SET_VALUE (TRANS_PARAMS, "ACTION", "KILL_ORDER")
TRANS_RESULT = SEND_TRANSACTION (30, TRANS_PARAMS)
END IF
END FOR
END IF
END FUNC
---------
' =========== УДАЛЯЕМ СТОП-ЗАЯВКИ
FUNC KILLALLSTOPORDERS(KEY)
MESSAGE ("СНИМАЕМ "&KEY,1)
N=GET_NUMBER_OF("STOP_ORDERS")
IF N>0
FOR I FROM 0 TO N
IF (GET_VALUE (GET_ITEM ("STOP_ORDERS", I), "STATUS")="ACTIVE") AND (GET_VALUE (GET_ITEM ("STOP_ORDERS", I), "SECCODE")=INSTRUMENT)
NEW_GLOBAL("TRANS_PARAMS", "")
NEW_GLOBAL("TRANS_RESULT", "")
TRANS_PARAMS = ""
TRANS_PARAMS = SET_VALUE (TRANS_PARAMS, "TRANS_ID", "7"&TIME)
TRANS_PARAMS = SET_VALUE (TRANS_PARAMS, "CLASSCODE", "SPBFUT")
TRANS_PARAMS = SET_VALUE (TRANS_PARAMS, "SECCODE", KEY)
TRANS_PARAMS = SET_VALUE (TRANS_PARAMS, "ORDER_KEY", GET_VALUE (GET_ITEM ("STOP_ORDERS", I), "NUMBER")&"")
TRANS_PARAMS = SET_VALUE (TRANS_PARAMS, "ACTION", "KILL_ORDER")
TRANS_RESULT = SEND_TRANSACTION (30, TRANS_PARAMS)
END IF
END FOR
END IF
END FUNC