@Safeer992 try doing it on DEINIT or write the variables into a text object with no colour and then it should save when it crashes into the text object.
Something like this will do it, just checks for a loss not specifically stop loss, If needed you can set flags using the on trade tab to check for stop loss being hit: https://fxdreema.com/shared/bVnlpEy6
This is quite a lot of work, start with this, above buy/sell have a pink for each trade block looking at the last trade, in the buy/sell block use in loop for lot and adjust by *1.5 (random number use the number you want to use), or you could do something like +0.1
@Safeer992
One solution is to declare an integer variable which will be initiated with a value of 0(=no position); give it a value of -1 when a short(sell) position is opened; give it a value of 1 when a long(buy) position is opened.
Add a condition stating : sell if variable = 0 or 1 ; buy if variable = 0 or -1.
This being said, be aware that these kind of "strategies" are smoke and mirrors, will make you loose money. You need inquiring seriously about it.