lib/ig_markets/dealing_platform/position_methods.rb
def validate_trailing_stop_constraints
          if trailing_stop
            raise ArgumentError, 'do not set stop_level when trailing_stop is true' if stop_level
            raise ArgumentError, 'set stop_distance when trailing_stop is true' unless stop_distance
            raise ArgumentError, 'set trailing_stop_increment when trailing_stop is true' unless trailing_stop_increment
          elsif trailing_stop_increment
            raise ArgumentError, 'do not set trailing_stop_increment when trailing_stop is false'
          end
        end
# Checks that attributes associated with the trailing stops are valid.
Checks that attributes associated with the trailing stops are valid.
Checks that attributes associated with the trailing stops are valid .
def validate_trailing_stop_constraints
          if trailing_stop
            raise ArgumentError, 'do not set stop_level when trailing_stop is true' if stop_level
            raise ArgumentError, 'set stop_distance when trailing_stop is true' unless stop_distance
            raise ArgumentError, 'set trailing_stop_increment when trailing_stop is true' unless trailing_stop_increment
          elsif trailing_stop_increment
            raise ArgumentError, 'do not set trailing_stop_increment when trailing_stop is false'
          end
        end
def validate_trailing_stop_constraints if trailing_stop raise ArgumentError , 'do not set stop_level when trailing_stop is true' if stop_level raise ArgumentError , 'set stop_distance when trailing_stop is true' unless stop_distance raise ArgumentError , 'set trailing_stop_increment when trailing_stop is true' unless trailing_stop_increment elsif trailing_stop_increment raise ArgumentError , 'do not set trailing_stop_increment when trailing_stop is false' end end
Checks that attributes associated with the trailing stops are valid.
Checks that attributes associated with the trailing stops are valid .