Want the code for the following so that the strategy can be backtested in pi on below mentioned set of criterias.
-
How do i define Exit long position when price target is achieved by 5% or may be 10 points after the entry point/buy price
-
How do i define fixed Stoploss of 5% or may be 10 points.
-
How do i define a trailing stop loss
-
How to define, if i want to say that any long/short positions should be squared off at the end of the day/3:35pm
-
How to define that do not enter any new position after 3:00pm even if appropriate signals are generated by the strategy.
-
I want to enter LONG only after 1 candle when MACD crossover has already happened and MACD is still > MACD signal line. (Means, suppose it is a 30 min candle and MACD crossover signal is generated at the close of 10:00am candle, then enter at open of 11:00am candle if still MACD > MACD signal.)
-
Please code Ehler Fisher Transform and Ehler Fisher Transform Trigger Crossover.