Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Quad), 843 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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