Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623
|
magik570,
īt depends a bit on what you mean with "when last traded price is more 9EMA", as there is a difference between price being above (which could be the case for several bars in a row) and price crossing above.
Take a look at the build in "MovAvg Cross LE" and "MovAvg Cross SE" strategies for an example of a strategy that takes an entry when price is above/below a simple moving average for X bars.
The build in "MACD LE" and "MACD SE" strategies demonstrate how to trigger an entry based on the cross over.
Either of these should help get you going for your entry. In case you need an example for how to call an exponential moving average, the build in "Mov Avg Exponential" indicator should be helpful.
For the end of day exit in backtesting take a look at the reserved word SetExitOnClose.
You will also need to compute your exit prices based on the entry into the trade (which you can get with the reserved word EntryPrice) and issue exits at these prices using BuyToCover (take a look at the build in platform help in case you need an example for how to use any of the reserved words).
Regards,
ABCTG
|