如題,想寫一個在台指期進場後跌50點就發出提醒的警示,但是在警示裡沒辦法用filledavgprice來取得目前的未平倉成本,想請教該怎麼修正,語法如下
// === 宣告變數 ===
Vars: isLong(false), isShort(false), myEntryPrice(0), stopPrice(0), stopLossAlert(false);
// === 多單停損檢查 ===
If isLong Then
Begin
stopPrice = myEntryPrice - 10;
If Low <= stopPrice Then
stopLossAlert = true;
End;
// === 空單停損檢查 ===
If isShort Then
Begin
stopPrice = myEntryPrice + 10;
If High >= stopPrice Then
stopLossAlert = true;
End;
4 評論