This functionality allows the algo to select strikes for entry based on the distance calculated from the ATM based on the straddle width setting.
Logic/method:
1. First the ATM strike is derived after checking the spot price.
2. Straddle price is calculated, ie. the premiums of ATM CE and ATM PE are summed up to get the total premium.
3. Straddle price (total premium) is multiplied by the straddle width setting defined by the user to get the straddle width value, which is then added or subtracted to the ATM strike to get the nearest strike to enter.
User settings:
1. + / - ( + for selecting strikes higher than the ATM strike and - for selecting strikes lower than the ATM strike).
2. Straddle width setting.
Example:
1. Suppose current spot price is 40023. The ATM strike is 40000.
2. If ATM CE premium is 222 and ATM PE premium is 273, then the total straddle premium would be ATM CE premium + ATM PE premium = 495.
3. If the user has given a straddle width setting of 0.5, then the straddle width value will be 495 x 0.5 = 247.5.
4. This straddle width value is added or subtracted from the ATM strike price based on the settings defined by the user:
(a) Setting for CE: ATM + 0.5
In this case, ATM strike + straddle width value,
= 40000 + 247.5
= 40247.5
Closest strike to 40247.5 is 40200, so strike selected will be 40200 CE.
(B) Setting for PE: ATM - 0.5
In this case, ATM strike - straddle width value,
= 40000 - 247.5
= 39752.5
Closest strike to 39752.5 is 39800, so strike selected will be 39800 PE.