You cannot replicate the signals from a chart strategy in the form of a scan. The strategy does contain signals which are used to plot the theoretical buys and sells. However those signals are generated by the strategy in a way that cannot be perfectly replicated in any scan. You can scan for the raw signals. But they will not always match the theoretical buys and sells you see on the chart.
Here is the code to scan for the raw signals used by the strategy. Subject to the limitations I just described:
input fastLength = 12;
input slowLength = 26;
input macdLength = 9;
input averageType = AverageType.EXPONENTIAL;
def diff = reference MACD(fastLength, slowLength, macdLength, averageType).Diff;
# use this to scan for buy signals
plot scan = diff crosses above 0;
# use this to scan for sell signals
#plot scan = diff crosses below 0;