Suppose if i am using strategy algorithm in backtesting,how to set the stoploss and target? define a function which can be added in all the strategies or quote one example!
Fixed target and stoploss for a trade cannot be backtested in PI with tradescript. You will have to use Amibroker for that.
you can place stoploss conditions in exit buy and exit sell check the below screenshots
Please mention time frame. for eg. 1 min, 5 min, 30 min, daily. weekly etc…It depends up on your selection of time frame.
I MEAN TO SAY SUPPOSE IF I HAVE A STRATEGY HOW TO DEFINE A PROPER TARGET AND STOP LOSS IN IT…I GAVE THE EXAMPLE ONLY…
You cannot put a fixed number or script in exit long/short that refers your buying/selling price +/- some number. The exit has to be through some technical indicator only.