Suppose I have entered a “Buy Script” in Back-testing and it has generated say 5 orders :
Order1, Order2… and so on.
Now I want to create a “Exit Long Script” where :
Order1 will exit if there is 1% rise in the stock price. Hence say for HDFC Bank if the Order1 buy was executed at 1405.10 and the “Exit Long” should happen when the price increases by 1% i.e. 1419.
Similarly if Order2 buy was executed at 1410.25 and the “Exit Long” should happen when the price increases by 1% i.e. 1424.35 for Order2.
In this case how to I create an “Exit Long Script” which refers to the Buy Order for Backtesting.