A simple code for buying/selling when price cross EMA

Created at 23 Jul 2020, 15:53
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
beej.sanchez's avatar

beej.sanchez

Joined 16.09.2019

A simple code for buying/selling when price cross EMA
23 Jul 2020, 15:53


Hi all,

I am new to ctrader algo and is wondering if somebody with a kind heart can help me with my first trading bot. The parameters are:

BUY when price cross above 10 EMA, provided that prices are ABOVE 200 SMA. Exit the current position if price cross down 10 EMA regardless of 200 SMA. Please note that bot will ONLY enter a long position when the two said criteria are met.

Its as simple as that. 

Thank you all


@beej.sanchez
Replies

firemyst
05 Sep 2020, 15:59

Easy code, but I would look in the "cbots" section on algorithms as I'm sure there's already numerous similar ones programmed.


@firemyst