Create Function that Calculates a Value Relative to Original Price and Also Constructs a Price Ladder

censo

Board Regular
Joined
Dec 25, 2015
Messages
161
Office Version
  1. 2013
Platform
  1. Windows
PREFACE

In options trading, a price ladder shows how much profit or loss (percent & dollar) is realized relative to current contract price. These figures are calculated by comparing the new price of a contract to the "base" or entry price.

Note: If the details below are too wordy or TL;DR, I provided a link to an explainer video with visual examples.


BACKGROUND

- New price is the point at which a trade is closed (this can be positive or negative, depending on how the trade went relative to the entry price).

- If new price is higher than original price, a profit is realized.

- If new price is lower than original price, a loss is realized.

- Contract prices are always multiplied by 100.

- The entire cost of a trade is calculated in this manner: contract price x 100 x quantity of contracts.

- On a price ladder, contract price moves up or down based on a user selected drop down cell (D2) (meaning, values go up or down by either .01 or .10)

- The values of the "P/L OPEN %" and "P/L OPEN $" on the price ladder are created based on the entry price (the key value from which all calculations are derived).

- As part of risk management, a stop loss prevents a trade from experiencing a loss greater than what is planned in the event the trade goes in the negative direction.


EXAMPLES

Original or "entry" contract price = $7.50 (x100) = $750

Qty contracts = 5

Total contract cost = 750*5 = $3,750


New or "exit" contract price = $8.30

Dollar Profit = ((8.30-7.50)*100)*5 = $400

Percent Profit = (8.30/7.5)-1 = 10.67%


Regarding stop loss, although the planned Stop Loss amount in C2 is $457, the correct contract price for this stop loss amount is 6.60 (A89) because it is okay to be below that amount ($450 in cell C89), not over it.

For example the contract price of 6.50 would exceed the stop loss because at that level, the loss would be $500 (C90) and that exceeds the stop loss amount of $457.



THE PROBLEM

The price ladder has to be created manually and sometimes I may not want to refer to an actual price ladder but rather, have the information I need automatically populated with a mathematical formula.



REQUESTED SOLUTIONS

#1 - To serve as a visual aid, create a function that when values A2:C2 are provided, a price ladder is automatically created (100% to the positive and 100% to the negative, as shown). The solution must account for the user defined input D2 (this value determines how the prices increase or decrease. In the example shown, price increases or decreases every $0.10 but if $0.01 is chosen from the dropdown, then the price ladder should reflect accordingly).

#1a - Since I want the population of the price ladder to be optional to the user, the formula must look for a TRUE value by way of a checkbox (E2). If the checkbox is ticked, populate the price ladder. If the checkbox is empty, do not populate the price ladder.

#1b - On the actual price ladder, the original (entry) price would have conditional formatting of YELLOW (as found in cell A2, which correlates to cell A80 in this example).

#1c - On the actual price ladder, the stop loss price would have conditional formatting of RED (as found in cell G2, which correlates to cell A89 in this example).


#2 - When values A2:C2 are provided, a contract price representing a stop loss level is populated in cell G2. This formula should be independent of the price ladder, meaning, If the price ladder is not present (no vertical or other type of lookup functions), the value would be derived mathematically.



EXPLAINER VIDEO

ONLINE SHEETS VERSION

EXCEL VERSION

Price Ladder.xlsx
ABCDEFGHIJ
1Contract Price (x 100)QTYPlanned Stop LossIncrement / DecrementDisplay Price Ladder?Position SizeContract Price Stop LossLegend
2750.0054570.13,750.00Entry Price
3Stop Loss
4Contract PriceP/L Open %P/L Open $
515.00100.00%3750
614.9098.67%3700
714.8097.33%3650
814.7096.00%3600
914.6094.67%3550
1014.5093.33%3500
1114.4092.00%3450
1214.3090.67%3400
1314.2089.33%3350
1414.1088.00%3300
1514.0086.67%3250
1613.9085.33%3200
1713.8084.00%3150
1813.7082.67%3100
1913.6081.33%3050
2013.5080.00%3000
2113.4078.67%2950
2213.3077.33%2900
2313.2076.00%2850
2413.1074.67%2800
2513.0073.33%2750
2612.9072.00%2700
2712.8070.67%2650
2812.7069.33%2600
2912.6068.00%2550
3012.5066.67%2500
3112.4065.33%2450
3212.3064.00%2400
3312.2062.67%2350
3412.1061.33%2300
3512.0060.00%2250
3611.9058.67%2200
3711.8057.33%2150
3811.7056.00%2100
3911.6054.67%2050
4011.5053.33%2000
4111.4052.00%1950
4211.3050.67%1900
4311.2049.33%1850
4411.1048.00%1800
4511.0046.67%1750
4610.9045.33%1700
4710.8044.00%1650
4810.7042.67%1600
4910.6041.33%1550
5010.5040.00%1500
5110.4038.67%1450
5210.3037.33%1400
5310.2036.00%1350
5410.1034.67%1300
5510.0033.33%1250
569.9032.00%1200
579.8030.67%1150
589.7029.33%1100
599.6028.00%1050
609.5026.67%1000
619.4025.33%950
629.3024.00%900
639.2022.67%850
649.1021.33%800
659.0020.00%750
668.9018.67%700
678.8017.33%650
688.7016.00%600
698.6014.67%550
708.5013.33%500
718.4012.00%450
728.3010.67%400
738.209.33%350
748.108.00%300
758.006.67%250
767.905.33%200
777.804.00%150
787.702.67%100
797.601.33%50
807.500.00%0
817.40-1.33%-50
827.30-2.67%-100
837.20-4.00%-150
847.10-5.33%-200
857.00-6.67%-250
866.90-8.00%-300
876.80-9.33%-350
886.70-10.67%-400
896.60-12.00%-450
906.50-13.33%-500
916.40-14.67%-550
926.30-16.00%-600
936.20-17.33%-650
946.10-18.67%-700
956.00-20.00%-750
965.90-21.33%-800
975.80-22.67%-850
985.70-24.00%-900
995.60-25.33%-950
1005.50-26.67%-1000
1015.40-28.00%-1050
1025.30-29.33%-1100
1035.20-30.67%-1150
1045.10-32.00%-1200
1055.00-33.33%-1250
1064.90-34.67%-1300
1074.80-36.00%-1350
1084.70-37.33%-1400
1094.60-38.67%-1450
1104.50-40.00%-1500
1114.40-41.33%-1550
1124.30-42.67%-1600
1134.20-44.00%-1650
1144.10-45.33%-1700
1154.00-46.67%-1750
1163.90-48.00%-1800
1173.80-49.33%-1850
1183.70-50.67%-1900
1193.60-52.00%-1950
1203.50-53.33%-2000
1213.40-54.67%-2050
1223.30-56.00%-2100
1233.20-57.33%-2150
1243.10-58.67%-2200
1253.00-60.00%-2250
1262.90-61.33%-2300
1272.80-62.67%-2350
1282.70-64.00%-2400
1292.60-65.33%-2450
1302.50-66.67%-2500
1312.40-68.00%-2550
1322.30-69.33%-2600
1332.20-70.67%-2650
1342.10-72.00%-2700
1352.00-73.33%-2750
1361.90-74.67%-2800
1371.80-76.00%-2850
1381.70-77.33%-2900
1391.60-78.67%-2950
1401.50-80.00%-3000
1411.40-81.33%-3050
1421.30-82.67%-3100
1431.20-84.00%-3150
1441.10-85.33%-3200
1451.00-86.67%-3250
1460.90-88.00%-3300
1470.80-89.33%-3350
1480.70-90.67%-3400
1490.60-92.00%-3450
1500.50-93.33%-3500
1510.40-94.67%-3550
1520.30-96.00%-3600
1530.20-97.33%-3650
1540.10-98.67%-3700
1550.00-100.00%-3750
Sheet1
Cell Formulas
RangeFormula
B5:B155B5=A5/$A$80-1
C5:C155C5=((A5-$A$80)*100)*$B$2
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,223,879
Messages
6,175,148
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top