Hi, I noticed in TOS studies that it buys or sells 100 shares. Is it possible to create a study to back test for selling verticle credit spreads? I've been researching code today. I'm not a coder but the easiest strategy is to sell a put credit spread using the 30 & 15 Delta, when price is above 30SMA, 50SMA, and 200 SMA. The expiration is monthly's 30-40 days. Sell a call credit spread with the opposite happens price below 30, 50, 200SMA. After watching youtube this is what I came up with but I'm stuck. Any help would be appreciated.
input shortMA length = 30;
input mediumMA length = 50;
input longMA length = 200;
def shortMA = SimpleMovingAvg(length = shortMAlength;
def mediumMA = SimpleMovingAvg(length = mediumMAlength;
def longMA = SimpleMovingAvg(length = longMAlength;
def buy =
YIKES!
input shortMA length = 30;
input mediumMA length = 50;
input longMA length = 200;
def shortMA = SimpleMovingAvg(length = shortMAlength;
def mediumMA = SimpleMovingAvg(length = mediumMAlength;
def longMA = SimpleMovingAvg(length = longMAlength;
def buy =
YIKES!
Last edited by a moderator: