Login Page - Create Account

Support Board


Date/Time: Mon, 29 Apr 2024 01:13:28 +0000



[User Discussion] - Trading System Based on Moving Average Crossover

View Count: 128

[2024-03-24 02:15:21]
User643426 - Posts: 93
I'm working on creating an Automated Trading System based on the Moving Average Crossover Study. I'm using the Cross of the 9EMA above the 21 EMA as a Buy Entry. However, I only want the Buy Entry to occur when price is above VWAP. I would like the Buy Exit to occur on the close below the 9EMA.

Conversely, the Sell Entry would be when the 9EMA crosses below the 21EMA but only when price is below VWAP and the Sell Exit would be when price closes above the 9EMA. Does anyone know how to do this?

If I only wanted the Buy and Sell Entries to occur upon the cross of the 9EMA Above/Below the 21 EMA with the Moving Average Cross Over Study as ID1, is the formula below correct? If so, I'm not sure how to add the qualifier to only make the trade when Above/Below VWAP.

Buy Entry:
=AND(ID1.SG1>ID1.SG2,CROSSFROMBELOW(C,ID1.SG1))

Buy Exit:
=C<ID1.SG1

Sell Entry:
=AND(ID1.SG1<ID1.SG2,CROSSFROMABOVE(C,ID1.SG1))

Sell Exit:
=C>ID1.SG1
[2024-03-24 17:42:55]
Sawtooth - Posts: 3982
Try this:

Buy Entry:
=AND(CROSSFROMBELOW(ID1.SG1,ID1.SG2),C>ID2.SG1))

Buy Exit:
=CROSSFROMABOVE(C,ID1.SG1)

Sell Entry:
=AND(CROSSFROMABOVE(ID1.SG1,ID1.SG2),C<ID2.SG1))

Sell Exit:
=CROSSFROMBELOW(C,ID1.SG1)

-where:
ID1.SG1 is the 9EMA
ID1.SG2 is the 21EMA
ID2.SG1 is the VWAP
[2024-03-25 01:09:43]
User643426 - Posts: 93
Thank you so much! I really appreciate that. Yes, that worked but it's not a very profitable strategy as it only works about 25% of the time. It would be ideal to have the buy/sell entry occur after 1-2 pullback candles on the 5-minute chart that hold VWAP as support/resistance and then have the entry occur at the above/below the high/low of the last pullback candle. I'm sure it's very complicated but was wondering if it's possible to write a code for that. Thanks again:)
[2024-03-25 04:05:51]
Sawtooth - Posts: 3982
I'm sure it's very complicated but was wondering if it's possible to write a code for that.
You can DM me.
[2024-03-25 23:23:42]
User643426 - Posts: 93
I definitely will. I just sent a DM request.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account