Grid trading seems to be more tricky to code for this very reason of dynamic entries based on past results. That's why a lot of grid strategies are based on moving averages or static gridlines 100pips apart.

I guess you could potentially store the values/condition in an array and enter the trade based on the historical key points e.g. if (price > array[0] or price > array[1] or price > array[2] etc.) then enter long

Last edited by Qw3rty; 07/22/20 09:43.