برای ساخت ستون، به دیدهبان آپشن بروید، یا از طریق میزکار باکس دیدهبان اضافه کنید؛ ستون محاسباتی را بزنید، نام بگذارید، کد را در ادیتور بنویسید و خروجی را با return برگردانید ، سپس ذخیره کنید.
مرجع: راهنمای فرمولنویسی · آموزش ویدیویی · نمونه فیلتر
بلکشولز و قیمت تئوری
calcBS() · مدل بلکشولز
اختلاف BS با سرخط تقاضا (درصد)
return calcRateChange(calcBS().bs, option.ti.buy1Price, 1);
دلتا رنگی
let d = calcBS().delta;
if (d == null) return '';
return style(roundNumber(d, 2), d > 0.5 ? '#16a34a' : d > 0.3 ? '#ea580c' : '#dc2626', '', 'دلتا');
اختلاف IV و HV پایه
let iv = calcBS().iv;
let hv = ua.hv;
if (!iv || !hv) return '';
let diff = roundNumber((iv - hv) * 100, 1);
return style(diff + '%', diff > 0 ? '#dc2626' : '#16a34a', '', 'IV − HV');
سر به سر
breakeven() · توضیح سر به سر
return calcRateChange(ua.ti.lastPrice, breakeven()) + '%';
let optionPrice = basePrice(option);
let be = option.type == 'call'
? optionPrice + option.strike
: option.strike - optionPrice;
return calcRateChange(ua.ti.lastPrice, be);
اسپرد و دفتر سفارش
نقدشوندگی
return askBidSpread() + '%';
if (!option.ti.buy1Price || !option.ti.sell1Price) return '';
return style(commaSeparator(option.ti.buy1Price), '#16a34a', '', 'تقاضا') +
' | ' + style(commaSeparator(option.ti.sell1Price), '#dc2626', '', 'عرضه') +
' | ' + style(askBidSpread() + '%', '#6b7280', '', 'اسپرد');
ارزش ذاتی و زمانی
ارزش ذاتی و زمانی
return style(roundNumber(intrinsic(), 0), intrinsic() > 0 ? 'green' : '#999');
return roundNumber(timeValue(), 0);
let iv = roundNumber(intrinsic(), 0);
let b = calcRateChange(intrinsic(), option.ti.lastPrice);
return iv + ' : ' + b + '%';
اهرم و فاصله استرایک
اهرم
return roundNumber(leverage(), 2);
return calcRateChange(ua.ti.lastPrice, option.strike, 1) + '%';
موقعیت باز و زنجیره
موقعیت باز · سقف OI
if (!option.openInterest) return '';
let chg = option.openInterestPC;
let chgColor = chg > 5 ? '#16a34a' : chg < -5 ? '#dc2626' : '#6b7280';
return style(rnwc(option.openInterest), '', '', 'OI') +
' | ' + style(roundNumber(chg, 1) + '%', chgColor, '', 'تغییر');
let status = option.chainOpen ? 'باز' : 'بسته/محدود';
let color = option.chainOpen ? '#16a34a' : '#dc2626';
return style(status, color, '', 'زنجیره') +
' | ' + style(roundNumber(option.chainFill, 0) + '%', '#ea580c', '', 'درصد سقف');
optionSE — همسررسید و قرارداد مقابل
let result = '';
for (let index = -2; index <= 2; index++) {
if (index == 0) continue;
let o = optionSE(index);
if (o) result += showDetail(o.namad, '#') + '<br>';
}
return result;
let opp = optionSE(0, 'os');
return opp ? showDetail(opp.namad, 'put') : '';
کاورکال — بازده سالانه
استراتژی کاورکال
let premium = option.ti.buy1Price;
let base = ua.ti.lastPrice;
if (!premium || !base) return '';
let pct = (premium / base) * 100;
return roundNumber(ytmProfit(pct, option.daysUntilMaturity), 1) + '%';
Bull Call Spread — هزینه و حداکثر سود
اسپرد صعودی
let nextCall = optionSE(1);
if (!nextCall) return '';
let debit = option.ti.sell1Price - nextCall.ti.buy1Price;
let maxProfit = (nextCall.strike - option.strike) - debit;
return style(commaSeparator(debit), '#ea580c', '', 'هزینه') +
' | ' + style(commaSeparator(maxProfit), '#16a34a', '', 'حداکثر سود');
ستون پیشرفته — اسپرد + نمودار استراتژی
ساخت استراتژی از فرمول · فیلتر معادل در نمونه فیلتر
let result = '';
let index = -1;
let minMonthly = var1 != '' ? Number(var1) : 2;
let minStrikeDist = var2 != '' ? Number(var2) : 10;
while (optionSE(++index) != undefined) {
let upper = optionSE(index);
if (!upper || upper.ti.buy1Volume == 0 || option.ti.buy1Volume == 0) continue;
let debit = (option.ti.sell1Price - upper.ti.buy1Price) * option.size;
let profit = ((upper.strike - option.strike) * option.size) - debit;
let yCapital = monthlyProfit((profit / debit) * 100, option.daysUntilMaturity);
let disStrike = calcRateChange(ua.ti.lastPrice, upper.strike);
if (yCapital >= minMonthly && disStrike > minStrikeDist && disStrike > 0
&& option.ti.sell1Price > 0 && upper.ti.buy1Price > 0) {
pos.add('buy', option.namad, 1, 'sell');
pos.add('sell', upper.namad, 1, 'buy');
result += showDetail(upper.namad) + ' : '
+ style(yCapital, 'green', '', 'سود ماهانه') + ' : '
+ style(disStrike, '#ea580c', '', 'فاصله اعمال');
result += pos.build('اسپرد ' + option.namad);
}
}
return result;
فرمولها در کتابخانه شخصی ذخیره میشوند و میتوانید هر کدام را بهعنوان فیلتر یا ستون سفارشی به دیدهبان اضافه کنید.