The code of post #2 works if everything is in line!
The thing is... you have to adjust your position size variable!
It is simply too high compared to your set initial equity of backtest settings! ( I only left PositionSize value in there in post #2 because you have set it to that value in your code of post #1 and I thought you would know what it means).
This sets position value. Look at your initial equity setting, it is same size! Does that make sense? No. Position value is not equal to initial equity.
Instead of PostionSize variable I suggest to you to use SetPositionSize() function instead. It provides better readability.
or set any other option within SetPositionSize(). But do not set spsValue to same size as initial equity.
Also set days to 2 recent days (or more) instead of one for testing.
Also play around with percent_amount variable within ApplyStop functions of 2nd post of this thread. If you set too high values then you will get less trades.
All is there in this thread to get you going (there already is target example in post #2. In addition there is AmiBroker knowledge base example(s). This is not spoon feeding thread. Do some own homework first. So far I only see demand, demand... for demand cases send resolution request to fxshrat at gmail dot com (for example).
You have set spsPercentOfEquity to 1000% instead of 100%!
Have I set it to 1000% above of your last post? Look carefully again.
Read the documentation of SetPositionSize for other options. Have you? It is linked in the post above your last one also!