So i'm trying to make a Strategy with the Crossing of MacD, alone the MacD isn't good and will only give a 48% winrate.
Now i want to filter out some of the bad trades using the 200EMA, Only going Short when the price is below and only going long when the price is above.
Like seen in this video ; https://www.youtube.com/watch?v=nmffSjdZbWQ&t=351s
I've tried putting it in a group with a 1% above or below seeing i would like to trade the trend and not a range.
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1)
return;
// Set 1
if ((CrossAbove(MACD1.Default, MACD1.Avg, 1))
// Condition group 1
|| ((Close[0] * 1) > EMA1[0]))
{
EnterLong(Convert.ToInt32(DefaultQuantity), "");
}
// Set 2
if ((CrossBelow(MACD1.Avg, MACD1.Default, 1))
// Condition group 1
&& ((Close[0] * 1) < EMA1[0]))
{
EnterShort(Convert.ToInt32(DefaultQuantity), "");
}
}
But this doesn't solve it and the script will still go long while under the 200ema.
Any advice?
Thanks!
Comment