Please, I need helc calculated lot size in grid orders

 
Example:
Initial range (pips) = 50 pips.
Multi range between orders = 2.
1st buy trade 0.1 lot;
2nd buy trade 0.2 lot opened below 50 pips on a new candle open. The indicators are still aligned;
3rd buy trade 0.4 lot opened below 100 pips on a new candle open. The indicators are still aligned;
      buy trade 0.8 lot skipped below 200 pips - The indicators NOT aligned;
      buy trade 1.6 lot skipped below 400 pips - The indicators NOT aligned;
4th buy trade 3.2 lot opened below 800 pips on a new candle open. The indicators are still aligned;

      buy trade 6.4 lot skipped below 1600 pips - The indicators NOT aligned;
5th buy trade calculated lot opened below 6400 pips on a new candle open. The indicators are still aligned;

please help me to create a formula for calculating the lot of the order, my brain is already broken

thanks