public StopLossRule(string name,
            TimeIntervalDefinition executeFrequency,
            Variable iterator,
            Statement statement,
            BooleanExpression stopLossCondition,
            Variable positionSet)

            : base(name, executeFrequency,
            // wrap the statement with for all loop
            // and null checking for position
               new ForAllStatement(
                    iterator, positionSet,
                    new IfStatement(new NotEqual(){
                        LeftExpression = new PropertyAccessor(iterator,"Currency"),
                        RightExpression = new Constant(typeof(DBNull),null)},
                        new CompositeStatement(
                            new List<Statement>{
                                    statement,
                                    new IfStatement(stopLossCondition,new PositionStopLoss(iterator))
                                }
                        )            
                    )
                    
                ), stopLossCondition, positionSet
            
            
            )
        {
        }
 public TakeProfitReEntryRule(string name, TimeIntervalDefinition executeFrequency, Statement statement, BooleanExpression condition, Variable positionSet)
     : base(name, executeFrequency, statement, condition, positionSet) { }
 public ConditionalRule(string name, TimeIntervalDefinition executeFrequency, Statement statement, BooleanExpression condition, Variable positionSet) :
     base(name, executeFrequency, statement)
 {
     _condition = condition;
     _positionSet = positionSet;
 }
 public StopLossReEntryRule(string name, TimeIntervalDefinition executeFrequency, Statement statement
     ,Variable positionSet, BooleanExpression stopLossCondition)
     : base(name, executeFrequency, statement, stopLossCondition, positionSet) {
 }
 public TradingRule(string name, TimeIntervalDefinition executeFrequency, Statement statement)
 {
     _name = name;
     _executeFrequency = executeFrequency;
     _innerStatement = statement;
 }