public double Execute(IPosition pos, int barNum)
 {
     if (pos == null)
     {
         return(0);
     }
     return(pos.CurrentProfit(barNum));
 }
        public static double GetProfit(this IPosition position, int barNum)
        {
            var result = position.EntryBarNum > barNum ? 0 : position.IsActiveForBar(barNum) ? position.CurrentProfit(barNum) : position.Profit();

            return(result);
        }