Hi, I'm new here using WL and, please, I need some help with that strategy code below.
It even plots the moving averages on the chart, but doesn't perform the operations.
Thanks in advance for attention!
The intention is simple: I have two 10 periods exponential moving averages, one of which is shifted by 1 period. When the non-shifted average cross over the shifted, a buy at the candle close must occur where the crossing occurs, with a stop loss below the low of this candle, being the trade exit (take profit), when the non-shifted average passes below the shifted.
CODE:
Please log in to see this code.
Size:
Color:
Hi Mario,
The code does
perform the operations and doesn't require changes. However, the entry will not trigger Alerts as it's an AtClose order. You should convert it into an AtMarket order as in code below for Alerts to work.
Check out the Wiki FAQ >
Alerts are not triggered.CODE:
Please log in to see this code.
Size:
Color:
Eugene, eternal thanks for the quick and accurate answer!
Size:
Color:
Mario,
My pleasure to help.
Size:
Color: