Hello There ! How could I code using For loop but end it with break(); method instead of defind end index in the first place.
Hello There ! How could I code using For loop but end it with break(); method instead of defind end index in the first place.
12 Apr 2021, 19:55
Hello There Everyone.
I have a little problem with the coding issue can't figure it out.
hope someone could guide me or give me some hint.
I would like to use for loop once and I don't know where the loop gonna end and it only ends when reaches some condition in for loop
(such as when the current price reach or beyond 1.777) we're calling break();
instead of using for(int i = 1;i < 10;i++){} like that
normally if we use a normal for loop we know where it's gonna end. but with OnTick(){} and Price movement, we don't know yet where and when the price is gonna meet our
condition so is there a way to code for loop and don't know where it's gonna end?
P.S. I try to write a method with for loop in it and put it on OnTick(){}
but doesn't work like I expect, It starts from the first Index to The lastIndex every new tick occurs.
I just want to use for loop only once and when it reaches the condition it break(); the loop that's it.
Thank you in advance.
Replies
PanagiotisCharalampous
13 Apr 2021, 09:37
Hi imrealfighter,
Check While Loops.
Best Regards,
Panagiotis
@PanagiotisCharalampous
imrealfighter
13 Apr 2021, 11:21
RE:
PanagiotisCharalampous said:
Hi imrealfighter,
Check While Loops.
Best Regards,
Panagiotis
Hello PanagiotisCharalampous Nice to meet you again and thank for your kind as always.
Thank you. I'll try it.
@imrealfighter
imrealfighter
12 Apr 2021, 20:05
Bring it in a nutshell
I want my for loop to run when a new tick occurs until it reaches a condition that has been set in the for loop.
@imrealfighter