I have my simple MA crossover (EMA 5 & EMA 13) strategy. So, the buy and short logic is simple and I am able to code it easily.
Now, the next thing is that ----once in a trade either BUY or SHORT is executed once , I want to close the trade with either lets say 10 points profit (profit booking logic) or 5 points loss (stop loss logic), which ever happens first.
Can it be achieved by using applystop function?
If, yes ----the please give me a starting point for the coding.
Otherwise , also please let me have the starting codes to achieve it alternatively.
Hi @santy. You will need to call ApplyStop() twice in your AFL: once for the stop loss, and again for the profit target. Documentation (with examples) for this function can be found here: https://www.amibroker.com/guide/afl/applystop.html
I encourage you to try it yourself and see what happens. You will learn very little if you just keep asking others to solve all your problems and answer all your questions.