Please help with this AFL AMIBROKER code

Hello,

i am new to afl coding

I Some how coded Implied volatility of options ,and i am able to get implied volatility ,but now i want the out come  i.e implied volatility as symbol in amibroker so that i can add oscillating indicators ,like ATR(which accepts only range)etc. But i am not able to do so please help me out how could i use result of an code as symbol ,so that i can add indictors to it

Following is the code

N( Symbol1= ParamStr("IV OPTION 1", "NIFTY15SEP7800CE") );

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


_N( Symbol2= ParamStr("IV OPTION 2", "NIFTY-I") );

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


function callprice(Stp ,stk,tim,inte,vk)//(stock price,time
{
StockPrice  = Stp;
Timedays    = tim; //Time to expiry ( days to

StrikePrice =stk; //strike Price of Option to

InterestRate= inte; //prevailing interest

VKnown =vk;//You can insert Known


//BLACK SHCOLES OPTION PRIFCING FORMULA
//coded by Anthony Faragasso
//1-01-03


//////////////////////////////////////////////////////

time=timedays/365;// days to expire conversion formula


//Formula variables below

/*************************************************/
// Solves for ( X )

x = (ln(stockPrice/strikePrice) + (interestrate +
Vknown*Vknown/2)*time)/(Vknown*sqrt(time));
/*************************************************/

P =  0.2316419;   
bb1 = 0.31938153;
bb2 = -0.3565638;
bb3 = 1.78147794;
bb4 = -1.821256;
bb5 = 1.33027443;

pi = 3.141592654; // PI

A2 = 1/sqrt(2*pi);
A3 = exp(-(x^2)/2);
y= a2*a3;
A4 = exp(-interestrate*time);
t1 = 1/(1+ P*x);
A5=(bb1*t1)+(bb2*t1^2) +( bb3*t1^3)+(bb4*t1^4)+(bb5*t1^5);
/************************************************************/
//Standard Normal Distribution Function of ( x )


N = 1- y *A5 ;

/************************************************************/
  // Solves for ( X1 )
X1=x-Vknown*sqrt(TIME);

y1=1/sqrt(2*pi);
N0=exp(-(x1^2)/2);
T2=1/(1+ P*X1);
A6=(bb1*t2)+(bb2*t2^2) +( bb3*t2^3)+(bb4*t2^4)+(bb5*t2^5);
A7=exp(-interestrate*time);
y2=y1*n0;

/************************************************************/
/* Standard Normal Distribution Function OF ( x1 )*/
/***********************************************************/
N2= 1-y2 * A6;

/************ CALL OPTION FAIR VALUE************/
Call = stockPrice  * N - strikePrice *  A4  * N2;

/************ PUT OPTION FAIR VALUE*************/

Put =  Call - stockprice  + strikeprice*A7;

kall=Call;
return kall;


}
Stp=C2;
stk=7800;
uy=day() ;

tim=(24-uy);
inte=0;
OptionValue=C1;

function impliedcall(Stp ,stk,tim,inte,OptionValue)

{
dVol = 0.00001;
epsilon = 0.00001;
maxIter = 100;
vol_1 = 0.25;
i =0; // starting point
do
{
 
 
  Value_1 =callprice(Stp ,stk,tim,inte,vol_1);
   vol_2 = vol_1 - dVol;
   Value_2 = callprice(Stp ,stk,tim,inte,vol_2);
   dx = (Value_2 - Value_1) / dVol;
  if( i > maxIter )
{

break;
}

 
   vol_1 = vol_1 - (OptionValue - Value_1) / dx;
 
 
 
  i = i + 1;
 
 
  }
 
 
 
 
 
 
 
 
while( ++i < BarCount );


ImpliedVolatility = vol_1;

return  ImpliedVolatility ;


}


calliv=impliedcall(Stp ,stk,tim,inte,OptionValue)/0.01 ;

cimp=impliedcall(C2 ,stk,tim,inte,C1)/0.01;

Try this  ATR   AFL:


//* ATR AFL Study:  */

Exclude = MA(V,50)<200 ;
MaxGraph = 12;
Graph0 = C;
Graph0Color = 1;
Graph0Style = 64;

BuyOffSet = 18;//Optimize("BuyOffSet",18,15,20,1);
SellOffset = BuyOffSet;//Optimize("SellOffset",2,2,14,2);
RegLength = 5;//Optimize("RegLength",5, 2,11,2);
BuyATRPeriod = 2;//Optimize("BuyATRPeriod",2,2,5,1);
SellATRPeriod = BuyATRPeriod;//Optimize("SellATRPeriod",4,2,11,2);
ATRMultiplier = 1;//Optimize("ATRMultiplier",1,0.7,1.25,.05);

Graph8 = HHV(H-ATRMultiplier*ATR(BuyATRPeriod),BuyOffset);   /* RED */
Graph9 = LLV(L+ATRMultiplier*ATR(SellATRPeriod),SellOffset);  /*  GREEN */

Graph8Style=Graph9Style = 5;
Graph9Color=  5;  /* 5 is green */
Graph8Color = 4;  /* 4 is red */

ticker = 0.0;//Optimize("Tickerk",0,0,1,0.125);

Buy = Cross(C,Graph8) AND C>Graph9 AND LinRegSlope(EMA(C,17),2)>0;
Sell = Cross(Graph8,C) AND LinRegSlope(C,2)<0;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
BuyStop = Ref(Graph8,-1)+ ticker;
BuyPrice = Max(BuyStop,Low);
SellStop= Ref(Graph8,-1);   //IIf(Cross(Graph8,C),Ref(Graph8,-1),0);
SellPrice = Min( SellStop, High )- ticker; 

//ApplyStop(2,3,Optimize("TrailingStop",15,0,20,5),1);

Filter=   (Buy OR Sell)      ;      
NumColumns = 8;
Column0 =  IIf(Buy==1,1,IIf(Sell==1,-1,0) );
Column0Format = 1.0;
Column0Name = "Long/Sell";
Column1 = C;
Column1Name = "Close       ";
Column1Format = 1.2;
Column2 = MA(V,17);
Column2Name = "17 Ma Vol   ";
Column2Format = 1.0;
Column3 = MA(C,17)/MA(C,50);
Column3Name = "% 17/50 ";
Column3Format = 1.2;
Column3Format = 1.2;
Column4= MA(C,17);
Column4Name="17 C ma";
Column4Format = 1.2;
Column5= MA(C,50);
Column5Name="50 C ma";
Column5Format = 1.2;

Column6= BuyPrice;
Column6Name="BuyPrice";
Column6Format = 1.2;
Column7= SellPrice;
Column7Name="Sellprice";
Column7Format = 1.2;

it is based on ATR and volume and no trailing stoploss