IA
Topics
11 Nov 2023, 09:10
465
2
29 Oct 2023, 08:51
336
2
Replies
ialhamdazeez
29 Oct 2023, 10:20
( Updated at: 30 Oct 2023, 06:23 )
Bars is an array beginning from the oldest price to current price. So you should first reverse it to begin from the current price, then skip the current price using skip function, then take the bars that you want to check for highest price using take function. Use the following code:
var bars = Bars.Reverse().Skip(1).Take(5).Where(b => b.High == Bars.Reverse().Skip(1).Take(5).Max(a => a.High));
// print the result
foreach (var b in bars)
{
Print("time: " + b.OpenTime.ToString() + ", price: " + b.Close.ToString());
}
@ialhamdazeez
ialhamdazeez
30 Oct 2023, 19:17
RE: How to define Stop loss
PanagiotisChar said:
Thanks, I read about martingales Strategy. It is exactly what I do in my cbot. It seems there is no solution
@ialhamdazeez