Test all numbers between two numbers

Created at 12 Jan 2014, 14:25
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
OL

Old Account

Joined 14.10.2013

Test all numbers between two numbers
12 Jan 2014, 14:25


Hi, i was wonder how I can test all numbers between for example the high an low of a bar.

Example:

/////////////////////////////////
if(High-Low == 1.3542)

Print("---");
/////////////////////////////////

So if the high value is 1.3600 and the low value is 1.3500 the robot would print ---

Thanks


@Old Account
Replies

modarkat
12 Jan 2014, 15:15

            var low = 1.12345;
            var high = 1.12355;
            for (var price = low; price <= high; price += Symbol.TickSize)
            {
                Print(price);
            }

 


@modarkat