@trader-philipps Ok, testet with modify variables block and works as well.

@trader-philipps Ok, testet with modify variables block and works as well.

@tns I think this doesn't work with ATR as it is a price fraction.

I use a custom mql block on the onInit tab to get the digits for pips multiplication like that ..

where vd_to_pips_multi you would multipli the ATR result with.
Maybe that function also works in a modify variables block. haven't tried, yet!
@khalids222 Check this. It's closer but probably still not what you want.
0_1578175676774_CONSULTNANT FX.mq4
What happens if there are several sells and several buys?

This sequence is
Sell
Buy
Buy
Sell
Sell
Buy
Sell
Which lot size each step should have?
@seb-0 I think fxdrema creates a function per custom mql code. However, I haven't used it to call from a different place and I have no idea how to do so.
Just created a cutom code block like that.

The mql result is like that ..
// Block 32 (PrintHelloWorld)
class Block19: public MDL_CustomCode<bool>
{
public: /* Constructor */
Block19() {
__block_number = 19;
__block_user_number = "32";
_beforeExecuteEnabled = true;
}
public: /* Callback & Run */
virtual void _callback_(int value) {
}
virtual void _beforeExecute_()
{
Print("Hello, World");
}
};
@errinjm If I test the indicator itself, it works (I use tickdata suite).
May you share your project?
@khalids222 Be more careful when creating your projects! Sample would have worked if you'd do what I did and write variables without spaces. Keep in mind that peopke help here voluntarily!
@khalids222 Can you share your project, please? I don't have an example around as martingale/averaging style is not what I usually build.
@tns Looks like your spread is extremely high. Maybe you used current spread in tester and it is extremely high because of weekend? Just a guess.
@errinjm On importing the indicator you see the buffers ..

Green is up, red is down.
Btw., how are you going to use it? o cross?
@seb-0 Use pow() or MatPow() function https://docs.mql4.com/math/mathpow
@traderscornerph Just from my crystal ball I guess you mean something like that ..

Example to limit up to 2 open trades.
@l-andorrĂ 49 only .. I lost as a noob 
@ambrogio Sure, but at least a bit of secure feeling it would give 
@l-andorrĂ String datatype is used for characters such as a b c, blanks and other special character and also numbers. However the values as numbers are not numbers to calculate with such as multiplication.
In order to transform a number in String datatype to a number in a numeric datatype you need to convert it.
In the given case there is a comma separated lost of numbers stored in a String datatype. In order to get it as numbers, you'd need to create an array of numbers from it and address each value from the array's index.
If you use the String (list of numbers) as a betting sequence, fxdreema does that work for you.
If you want to do this manually, you need to implement the de-seralization by yourself.
@ambrogio If you use virtual stops you should also consider using the emergency stop function in case the connection to the broker gets lost!
@ambrogio Take a look here, I think in my example I do similar things https://fxdreema.com/forum/topic/8455/how-can-i-collect-the-latest-open-positions-in-the-event-of-a-trend-change/5
@errinjm Well, many authors don't user the SetIndexLabel function in order to make it readable. In tat case you'd just see Buffer 0, Buffer 1 etc. on importing the indicator. If you only have the ex4 file and not the sources of the indicator, you need to set the buffers by yourself.
If you could share it, I might take a look.
@khalids222 I haven't tested it, but I'd do the following on the onTrade tab (regular use not after EA restart):

Have 2 variables and loop through all Buy and Sell trades and increase thevariable value by the lot size of the trade in the loop.
Once you have stored them, you may use the sell variable value + your increment (eg. 0.01) for buy trades and vice versa.
If you restart your terminal you may need to let the calculation run as well somewhere if there are already open positions.
@khalids222 Very hard to get your problem. Do you want a seperate sequence per buys and sells?
Like Buy 0.10, 0.20, ...
Sell 0.10, 0.20, ... ??