Workshop8: Options, Not getting the same results

Posted By: 3dvg

Workshop8: Options, Not getting the same results - 06/13/21 19:16

Hi, just doing this Workshop 8: Options and no success. I literally just copy pasted the code from the Workshop, added start and end dates and downloaded the free SPY data from https://www.zorro-trader.com/download.php.

Attached bellow the code and Chart comparisons

Code
#include <contract.c>

#define PREMIUM  2.00 // $200 per contract 
#define DAYS     6*7  // 6 weeks to expiration

void run() 
{
  set(PLOTNOW,LOGFILE);
  BarPeriod = 1440;

  StartDate = 20120101;
  EndDate = 20190101;
  History = ".t8"; // use options for price history
  assetList("AssetsIB");
  asset("SPY");
  Multiplier = 100;

// load today's contract chain
  if(!contractUpdate(Asset,0,CALL|PUT)) return; 

  if(!NumOpenShort) { 
// find contracts with 6 weeks expiration and $2 premium
    if(combo(
      contractFind(CALL,DAYS,PREMIUM,2),1, 
      contractFind(PUT,DAYS,PREMIUM,2),1,
      0,0,0,0)) 
    { // sell a Strangle
      MarginCost = comboMargin(-1,3);
      enterShort(comboLeg(1));
      enterShort(comboLeg(2));
    }
  }
}


Attached picture comparison.png
Posted By: jcl

Re: Workshop8: Options, Not getting the same results - 06/14/21 07:04

If you mean with 'no success' that your equity curve differs from the manual: I believe that curve was generated with artificial data.
© 2024 lite-C Forums