How to set profit target ?

How do I give a buy condition with stop loss and target?

Should I give sell = 0; and then use apply stop both for stoptypeloss and stoptypeprofit ?
Please guide me since its saying that sell can't be zero in case of backtesting .

You can set Sell to 0, but you can't leave it undefined or the backtest will complain. And yes, you can use ApplyStop twice: once for your stop loss and once for your profit target.

@besttrader please see the below links for backtest via amibroker here. For setting profit target or stoploss you can refer here