How to plot lowest price straddle (call + put) on price chart?

You guys are really amazing to have. Thanks for all the help that you all do.
I want to plot the lowest value straddles (call and put with same strikes) on price chart
So lets say NIFTY index is at 11500.
I will compare the following values first
11200 call + 11200 put
11300 call + 11300 put
11400 call + 11400 put
11500 call + 11500 put
11600 call + 11600 put
11700 call + 11700 put
11800 call + 11800 put

Then whichever straddle (combination) has the least value, I want it to be plotted on the price chart. Please note that during the day, this combination might change due to change in Nifty index but I just want a continuous flow of the prices.

Thanks a lot

1 Like

Would love to have someone who replies here.

Isn't it possible guys ?

Since you're not getting a response, you may want to review this: How to ask a good question

It's definitely possible to do what you're attempting, but there is not enough information provided to help you with a solution, and you have not shown any of your own efforts.


Thank you so much sir for replying. I apologize for not sharing my code which I prepared. Also, I hope my question makes sense because I have mentioned almost everything which makes it understandable.

Here is the code that I have prepared

symbol1 = ParamStr("instrument1","NIFTYWK11500CE");
symbol2 = ParamStr("instrument2","NIFTYWK11500PE");
symbol3 = ParamStr("instrument3","NIFTYWK11600CE");
symbol4 = ParamStr("instrument4","NIFTYWK11600PE");
symbol5 = ParamStr("instrument5","NIFTYWK11700CE");
symbol6 = ParamStr("instrument6","NIFTYWK11700PE");
symbol7 = ParamStr("instrument7","NIFTYWK11800CE");
symbol8 = ParamStr("instrument8","NIFTYWK11800PE");
symbol9 = ParamStr("instrument9","NIFTYWK11900CE");
symbol10 = ParamStr("instrument10","NIFTYWK11900PE");

open1 = Foreign(symbol1,"Open");
open2 = Foreign(symbol2,"Open");
high1 = Foreign(symbol1,"High");
high2 = Foreign(symbol2,"High");
low1 = Foreign(symbol1,"low");
low2 = Foreign(symbol2,"low");
close1 = Foreign(symbol1,"close");
close2 = Foreign(symbol2,"close");
open3 = Foreign(symbol3,"Open");
open4 = Foreign(symbol4,"Open");
high3 = Foreign(symbol3,"High");
high4 = Foreign(symbol4,"High");
low3 = Foreign(symbol3,"low");
low4 = Foreign(symbol4,"low");
close3 = Foreign(symbol3,"close");
close4 = Foreign(symbol4,"close");
open5 = Foreign(symbol5,"Open");
open6 = Foreign(symbol6,"Open");
high5 = Foreign(symbol5,"High");
high6 = Foreign(symbol6,"High");
low5 = Foreign(symbol5,"low");
low6 = Foreign(symbol6,"low");
close5 = Foreign(symbol5,"close");
close6 = Foreign(symbol6,"close");
open7 = Foreign(symbol7,"Open");
open8 = Foreign(symbol8,"Open");
high7 = Foreign(symbol7,"High");
high8 = Foreign(symbol8,"High");
low7 = Foreign(symbol7,"low");
low8 = Foreign(symbol8,"low");
close7 = Foreign(symbol7,"close");
close8 = Foreign(symbol8,"close");
open9 = Foreign(symbol9,"Open");
open10 = Foreign(symbol10,"Open");
high9 = Foreign(symbol9,"High");
high10 = Foreign(symbol10,"High");
low9 = Foreign(symbol9,"low");
low10 = Foreign(symbol10,"low");
close9 = Foreign(symbol9,"close");
close10 = Foreign(symbol10,"close");

open12 = open1+open2;
high12 = high1+high2;
low12 = low1+low2;
close12 = close1+close2;
open34 = open3+open4;
high34 = high3+high4;
low34 = low3+low4;
close34 = close3+close4;
open56= open5+open6;
high56 = high5+high6;
low56 = low5+low6;
close56 = close5+close6;
open78= open7+open8;
high78 = high7+high8;
low78 = low7+low8;
close78 = close7+close8;
open910= open9+open10;
high910 = high9+high10;
low910 = low9+low10;
close910 = close9+close10;


This code plots all the straddles on one chart, but I am more interested in only one straddle which is the lowest out of all of these at all times. So surely the straddles might also change during the day.

@Malibutown, How are you defining "straddle which is lowest"?

If you define it mathematically, you can program it.

Check this one .

I think, if you bring these option strikes with with foreign function, and plot addition of those values, you will get the line showing these pairs. (I am also very new hence not writing any codes as of now) .

Amibroker reference :slight_smile:

  1. Call those option in your code :
  2. Add those option
  3. Plot line (you can plot anything, including line) :

Seniors please review and correct if I am missing something.

You still haven't verified your licence as pointed out to you by TrendSurfer three days ago.

Hi, I have done it just now, please check if it shows.

Yes it does. Thank you.

1 Like