AMIBROKER CODING HELP NEEDED.

#1
Plz help me code this .

I want to plot the sum of Ce and Pe (only close price ) in a Line chart. Basically a straddle .

I want it to plot 3 different straddles. Like for eg. Banknifty straddle of 28000 blue line , 28100 red line and 28200 green line in a single chart.

But I want it to choose the strike ,expiry automatically.

Like for eg. if I select the 28000CE strike , it should automatically plot the 28000 straddle sum and also +100 points away which is 28100 straddle sum and further + 200 points away 28200 straddle sum in a single chart.

So basically I just need to select or open one strike and rest everything should be done .

I know its a bit complicated but I'm sure it can be done.

Experts please help. Attached a screenshot how it should look like.
 

Attachments

ksesha

Active Member
#2
Try this

_N( Symbol1= ParamStr("ATM Straddle CE", "NIFTY18AUG11700CE.NFO") );
_N( Symbol2= ParamStr("ATM Straddle PE", "NIFTY18AUG11700PE.NFO") );

SetForeign( Symbol1 );
C1 = C;
H1 = H;
L1 = L;
O1 = O;
V1 = V;

RestorePriceArrays();

SetForeign( Symbol2 );
C2 = C;
H2 = H;
L2 = L;
O2 = O;
V2 = V;

RestorePriceArrays();


SP = (C1+C2);

Plot(SP,"Stradde Price",colorGreen);
 
#3
Try this

_N( Symbol1= ParamStr("ATM Straddle CE", "NIFTY18AUG11700CE.NFO") );
_N( Symbol2= ParamStr("ATM Straddle PE", "NIFTY18AUG11700PE.NFO") );

SetForeign( Symbol1 );
C1 = C;
H1 = H;
L1 = L;
O1 = O;
V1 = V;

RestorePriceArrays();

SetForeign( Symbol2 );
C2 = C;
H2 = H;
L2 = L;
O2 = O;
V2 = V;

RestorePriceArrays();


SP = (C1+C2);

Plot(SP,"Stradde Price",colorGreen);
Firstly thanks for your reply and effort.

Yes this is nice for 1 straddle . As I mentioned I want to plot 3 different straddles in a single chart.
For eg.
If my first straddle is NIFTY11700 CE+ PE. Blue line.
Then automatically it should add +100points for the second straddle which will be 11800CE+PE - Red line
and same for 3rd straddle which will be +200 points 11900CE+PE. -Green line.
 
#4
Can someone help me to prepare an scan alert AFL for following conditions
1. Buy when RSI 10 goes above 50
2. Sell when RSI 10 goes below 50
I'm asking for an alert AFL so that I can scan all 210 fno stocks.
 
#5
Can someone help me to prepare an scan alert AFL for following conditions
1. Buy when RSI 10 goes above 50
2. Sell when RSI 10 goes below 50
I'm asking for an alert AFL so that I can scan all 210 fno stocks.
Request u to create a new thread for it . I am looking for something very different.
 

travi

Well-Known Member
#7
Can anybody suggest a good real time data provider for amibroker.
Post in relevant thread.

Anyway, RTD is provided by GDFL and Truedata.
I've heard and tested but not extensively, that is Amifeed which provides hundreds of symbols at low cost fixed price.
Trade-off is that it has a 1-2 sec lag but otherwise worked fine.
 

Similar threads