Skip to content

Instantly share code, notes, and snippets.

View DarqueWarrior's full-sized avatar

Donovan Brown DarqueWarrior

View GitHub Profile
=LEFT([@Description],5) = " CALL"
=LEFT([@Description],4) = " PUT"
@DarqueWarrior
DarqueWarrior / Exposure.txt
Created March 12, 2024 01:42
Populates a column with the total value of the strike price multiplied by the number of contracts sold.
=IF([@[Sell To Open]], [@Contracts] * [@[Strike Price]] * 100, "")
@DarqueWarrior
DarqueWarrior / OptionContractsCount.txt
Created March 12, 2024 01:38
Populates a column with the absolute value of the number of contracts for the option trade.
=IF([@[Option Trade]], IF([@[Sell To Open]], [@Quantity] * -1, [@Quantity]), "")
@DarqueWarrior
DarqueWarrior / TickerSymbol.txt
Created March 12, 2024 01:36
Populates a column with ticker symbol for each row of the Fidelity transaction history download if it was an option trade.
=IF([@[Option Trade]],
MID([@Action], FIND("(", [@Action]) + 1, FIND(")", [@Action]) - FIND("(", [@Action]) - 1),
"")
@DarqueWarrior
DarqueWarrior / StrikePrice.txt
Created March 12, 2024 01:32
Populates a column with strike price for each row of the Fidelity transaction history download if it was an option trade.
=IF([@[Option Trade]],
NUMBERVALUE(MID([@Action], FIND("$", [@Action]) + 1, FIND(" ", [@Action], FIND("$", [@Action])) - FIND("$", [@Action]) - 1), "."),
"")
@DarqueWarrior
DarqueWarrior / BuyToClose.txt
Created March 11, 2024 22:31
Populates a column with TRUE or FALSE for each row of the Fidelity transaction history download if this was a Buy To Close option trade.
=LEFT([@Action], 19) = " YOU BOUGHT CLOSING"
@DarqueWarrior
DarqueWarrior / SellToOpen.txt
Created March 11, 2024 22:31
Populates a column with TRUE or FALSE for each row of the Fidelity transaction history download if this was a Sell To Open option trade.
=LEFT([@Action], 17) = " YOU SOLD OPENING"
@DarqueWarrior
DarqueWarrior / OptionTradeV2.txt
Created March 11, 2024 14:40
This function will identify option trades using Buy To Close and Sell To Open.
=OR([@[Buy To Close]],[@[Sell To Open]])
@DarqueWarrior
DarqueWarrior / expirationDate.txt
Last active March 11, 2024 01:24
This Excel function will extract the expiration date in an Excel Date time serial number format from the Action column from a Fidelity CSV download file.
=IF([@[Option Trade]],
DATE(
LEFT(YEAR(NOW()),2)&MID([@Action],FIND("$",[@Action])-3,2),
MONTH(MID([@Action],FIND("$",[@Action])-10,3)&1),
MID([@Action],FIND("$",[@Action])-6,2)
),
"")