Using the Number in Symbol Name to trade..not working correctly

Hello,

I've created a strategy wherein I'm Backtesting if the price = some value which is in the Ticker Name.
But this strategy is working very strangely..Works perfectly sometimes..and other times doesn't trade at all..
I've checked the values..all are perfect..and since its working perfectly 90%..I don't have doubt on AFL ?

It doesn't show results correctly..is there something I'm doing incorrectly ?

AFL

// symbol is : O:BANKNIFTY 18B25900.00D08-NSO
str=25900;
cc=StrToNum(StrRight(StrLeft(Name(),19),5))==str;
Short=cc;
Cover=0;

I'm expecting it to short at the first candle of the Symbol..

When you say "other times doesn't trade at all", do you mean during certain date ranges within your back test you see no trades, or do you mean you run the back test once and it works fine, and then run the back test again and get no trades? The latter is probably an indication that you're not being consistent with your settings, so saving everything in a project (APX) file would help you avoid that.