Intraday price and execution signals


First time programmer with Amibroker. I am unclear about how to create logic for a crossover signal. Videos show the crossover code for things like EMA functions but I cannot find the logic for triggering a buy or sell when current price crosses over a band or EMA line. Do I need to set up differently if I need to execute intraday versus buying on close or open timing?

I have defined an EMA as well as bollinger or standard deviation bands to establish parameters to trigger buy and sell orders. Ideally I would like to add a condition related to a 20 day lenar regression average to the entry of the strategy.

any feedback about how to set up for intraday execution of buy and sell signals and what best to use for conditional rules for entry of a trade,

THX for your help
I apologize if the questions are basic as I am not a programmer so experience is very limited.




All crosses are detected using Cross function
Whenever input is MA, EMA, Band or whatever else does not really matter:

InputA = Close; // whatever other input you want
InputB = EMA( Close, 20 );

Buy = Cross( InputA, InputB ); // the cross works with any input and gives True if InputA crosses ABOVE InputB

To combine conditions use AND/OR operator, so to "generate buy when current price crosses over a band or EMA line." you would write:

Buy = Cross( Close, your_ema ) OR Cross( Close, your_band );

Intraday vs EOD depends just on Periodicity that you select in Analysis SETTINGS window.


1 Like