Can applystop be the only Sell signal?

A couple questions:
Can applystop be the only sell signal to generate a basic profit target. Is there a better/correct way to simulate a 5% profit limit sale order.

When I use applystop like below with no other sell conditions in backtesting EOD OHLC data, numerous positions are exited for a loss. All other backtesting settings are kept at default and no other stops are active. Reverse entry forces exit is not checked in settings.

I am not sure why positions would exit for loss with this code instead of remaining open indefinitely. Does having sellprice = close, override ExitatStop = 1

AFL Function Reference - APPLYSTOP
ExitAtStop = 1 - check High-Low prices and exit intraday on price equal to stop level on the same bar when stop was triggered

Thank you in advance,

Buy = condition; 
Sell = ApplyStop ( stopTypeProfit, stopModePercent, 5, ExitAtStop = 1,  Volatile = False, 0, 1, -1, 0);
BuyPrice = Close; 
SellPrice=  Close; 

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);

Please read ApplyStop() documentation carefully.
https://www.amibroker.com/guide/afl/applystop.html
http://www.amibroker.com/kb/index.php?s=applystop
Also forum has lots of posts about ApplyStop already.
https://forum.amibroker.com/search?q=applystop%20order%3Alatest

Your code is incorrect.
There are numerous examples on how to use it already.

ApplyStop does not return anything. It is a procedure.

9

If you do not want to apply regular Sell then set Sell to zero (false).

Also you do not need to apply ExRem in analysis as default backtester removes excessive signals already.
And in chart you have to apply Equity function to evaluate stops. See documentation.

// Incomplete code snippet

Buy = condition; 
Sell = 0;// No regular sell just stop to exit

// ApplyStop is procedure and does not return anything
ApplyStop( stopTypeProfit, stopModePercent, 5, ExitAtStop = 1,  Volatile = False, 0, 1, -1, 0);

BuyPrice = Close; 
SellPrice=  Close;

Also you might have to check whether other stops are disabled.