Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
Deeplearning Script
by wolfi. 02/26/24 12:46
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/22/24 16:22
AssetAdd() vs. modern asset list?
by jcl. 02/21/24 15:01
How many still using A8
by Aku_Aku. 02/20/24 12:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, AndrewAMD), 567 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Active Threads | Active Posts | Unanswered Today | Since Yesterday | This Week
Starting with Zorro
03/06/24 09:27
Updated ZorroTraderGPT to version 2.6

And if you consider helping out, you can always help find the bugs, and improve on our ideas, Thank you.

Code
#include <contract.c>

// Define your global parameters such as target profit, days to expiration, and strike price offset
var TargetProfit = 500; // Example target profit
int DaysToExpiration = 30; // Target days until expiration
var StrikeOffset = 50; // Offset from the current price for strike selection

void run() {
  // Setup basic parameters
  BarPeriod = 1440; // Use daily bars
  LookBack = 0; // No need for historical bars in options trading setup
  StartDate = 2020;
  EndDate = 2024; // Set your backtest period
  assetList("AssetsIB");
  asset("SPY"); // Example using SPY ETF as the underlying asset

  // Ensure we're trading in American Options for SPY
  AmericanOption = 1;

  // Update the contract chain for the underlying asset
  if(!contractUpdate(Asset, 0, CALL | PUT)) return;

  // Trading logic executed once per day
  if(is(EXITRUN)) return; // Skip logic at the end of the backtest
  
  // Define your strangle strategy here
  if(NumOpenLong + NumOpenShort == 0) { // Check if there's no open position
    // Calculate target strike prices based on current price and offset
    var CurrentPrice = priceClose(0);
    var StrikeCall = CurrentPrice + StrikeOffset;
    var StrikePut = CurrentPrice - StrikeOffset;

    // Attempt to find and enter a Strangle combo
    if(combo(
      contractFind(CALL, DaysToExpiration, StrikeCall), 1, // Buy 1 Call
      contractFind(PUT, DaysToExpiration, StrikePut), 1,  // Buy 1 Put
      0, 0)) { 
        // Enter the combo trade
        enterLong(comboLeg(1)); // Enter long for the call option leg
        enterLong(comboLeg(2)); // Enter long for the put option leg
    }
  }

  // Monitor and manage open positions
  for(open_trades) { // Loop through all open trades
    if(TradeIsOption && TradeIsOpen && (comboProfit(TradePriceClose, 1) > TargetProfit || daysToExpiration() < 5)) {
      exitTrade(ThisTrade); // Close the trade if target profit is reached or approaching expiration
    }
  }
}

// Placeholder function for days to expiration calculation - implement as needed
int daysToExpiration() {
  // Custom logic to calculate and return days to expiration for the current combo
  return 10; // Placeholder return value
}

// Placeholder function for calculating combo profit - implement based on actual requirements
var comboProfit(var CurrentClosePrice, int Leg) {
  // Custom logic to calculate and return profit for the combo based on current prices
  return 600; // Placeholder return value
}
16 2,155 Read More
Editors & Templates
03/01/24 19:06
With the new version of the C/C++ Extension (1.19.4) I've encountered problems with the IntelliSense. Moving back to an older versions (at least 1.19.0) helps to solve the issue.
1 881 Read More
Blame the Manual
02/26/24 12:46
Hello tomaslolo - thank you for your comments!
Tested several installation methods, including your advise, nothing worked at the end.
Checked with debugview the keras script running. It is possible to start multiple zorro(s) for wfo in parallel, but all exit after the neural.training silently. The next step neural.save cannot open - r is not running anymore.
I do not have any idea what to do, so i will stop my activities in this issue at the moment.
Best regards!
2 623 Read More
Jobs Wanted
02/22/24 16:22
Looking for new projects to score!
90 31,554 Read More
Blame the Manual
02/21/24 15:01
I believe the leverage behavior is the same as in the asset list. Negative margin cost should work, but leverage will also still work.
1 264 Read More
A8 Engine
02/20/24 12:18
I am still using this package, and I am working on a nice project.
17 2,126 Read More
Zorro and the Brokers
02/19/24 19:12
Hi @turbodom, I was trading cash and carry. I have also used it as an input to an indicator.
14 2,127 Read More

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1