Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (howardR), 650 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Workshop8: Options, Not getting the same results #483545
06/13/21 19:16
06/13/21 19:16
Joined: Sep 2020
Posts: 7
3
3dvg Offline OP
Newbie
3dvg  Offline OP
Newbie
3

Joined: Sep 2020
Posts: 7
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 Files comparison.png
Re: Workshop8: Options, Not getting the same results [Re: 3dvg] #483548
06/14/21 07:04
06/14/21 07:04
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
If you mean with 'no success' that your equity curve differs from the manual: I believe that curve was generated with artificial data.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1