Vars
Global Integer id(0);
Global Bool subFlag(False);
Events
OnReady()
{
if(!subFlag)
{
id = SubscribeBar(RelativeSymbol, "1d", BeginDateTime);
subFlag = True;
}
}
OnBar(ArrayRef indexs)
{
Buy(1, Open);
Sell(1, Open);
Numeric volty = Volatility(data[id].Close);
Print("Delta:" + Text(Delta(TradingDayLeft, StrikePrice, data[id].Close, 5, volty, OptionType, OptionStyle)));
}