My only issue is this is NOT the van tharps SQN number. In order to know what the SQN number is you need to know what the R (risk per trade) is for each trade. All this is doing is taking your number of trades multiplied by the avgProfit then divided the total by its standard deviation.
I would recommend that you read the book before claiming to have an indicator claiming to be something it is not.
Keep working at, it..
SQN is a powerful statistic, I would hate someone to be misled into thinking this is the SQN..