top of page

2MOON explained:
Inside the engine

Business Rules

File Handler

  • This module is essential for reading and processing the file provided by the user, ensuring a proper understanding of the contained data.

 

Main Positions Handler

  • This crucial component interprets the specific rules each user establishes for their trading strategies. It meticulously analyzes the required fields in the user-submitted form for opening and closing positions. Key aspects include:

  • Start Delay: Ignore opening signals for the initial minutes following the market open at 9:30 AM.

  • Pause Delay: Disregards opening signals during the minutes leading up to the market close at 4:00 PM.

  • Strategy Type Identification: Categorizes strategies into different types, such as T1 (buying calls or puts), T2 (credit spread), T4 (debit spread), T7, and T5 (naked positions, with T7 opening both calls and puts, and T5 only calls).

 

Subprocesses within the Main Positions Handler

 

  • Open Position Handler:

  • Responsible for initiating each trading operation. It identifies the price of the underlying asset at the trade's opening and selects the appropriate contract chain based on the "expiration period" set by the user. For example, a weekly configuration that selects "same week" means trades started on Monday will expire on that week's Friday.

 

  • Optimal Contract by Delta Handler:

  • Uses deltas provided by users as a reference to select a contract close to that delta. This process continually updates the implied volatility of each asset (information provided by CBOE) and applies the Black-Scholes formula to calculate the delta for each strike price in the selected chain. It then chooses the contract with the closest delta to the reference, determining the contract's entry price.

 

  • Close Positions Handler:

  • This subprocess manages the closing of open positions. For strategy type 1, if an opposite position signal is received, the current position is closed, and a new trade is opened based on the new signal. For other strategy types, a specific closing signal reflected in the files is awaited. This process records the contract's price and the price of the underlying asset at the time of closing. If a position expires without receiving a closing signal, it calculates the trade's outcome.

bottom of page