Derive buy/sell signal from a one ticker and using buyprice/sell price of another ticker

I have written a code in which the buy/sell signals are calculated based on the prices of NIFTY ticker.

Now i want to use buyprice/sellprice/shortprice/coverprice from ticker name "NIFTY_F1".

I have written code and it is not taking buyprice/sellprice/shortprice/coverprice from ticker name "NIFTY_F1", instead it is taking prices from NIFTY ticker itself and that too only HIGH and LOW of NIFTY. Below is my code.

Buy = IIf( SuperTrend<Close, 1, 0);
Sell = IIf( SuperTrend>Close, 1, 0);




closePrice = Foreign( "NIFTY_F1", "C" );

buyPrice = ValueWhen(Buy, closePrice);
sellPrice = ValueWhen(Sell, closePrice);
shortPrice = ValueWhen(Short, closePrice));
coverPrice = ValueWhen(Cover, closePrice);

I also tried using below code and using C1 in place of closePrice in above code . But no luck.

SetForeign( NIFTY_F1 );
C1 = C;
O1 = O;

Please help. I dont know what im doing wrong. Let me know if you need more clarification on question.

I also attached snaps. Please find attached. Backtest Chart

Thread closed until original poster proves purchase of the license.

Only users with License verified badge are allowed to post on this forum.

So before posting, make sure you verify your license as explained here.