[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fw: 2 timeframes - triggering trades at the wrong place



PureBytes Links

Trading Reference Links

----- Original Message -----
From: "foolsgold" <foolsgold0@xxxxxxx>


> Hello trader,
> I had a look at this on TS4,
> I see in your gif, the yellow dots for your MACD are plotting 1
> dot per 12min bar which look correct.
> Strangely my MACD even though I have it coded to plot data2 12min is
> still returning a value and placing a dot at every data1 3min bar.
>
> Check the data window and see what values your macddif
> calculation is returning

It indeed must be something in that direction but... i can not find what it
exactly is....

Attached a screenshot. The red retangle clearly shows that the MACD
on the 12 minute data is down and indeed, the yellow line, representing
the 3 minute MACD is going up. At that point a trade is triggered.

That would suggest that it might be that the 3minute data1 datastreem
MACD diff is being used instead of the programmed data2 12 minute
data.

However, looking at the blue retangle, the data1 3 minute MACD is
again going up and if the above were true, it should trigger a trade.
And.... it does not.

For some reason i have the feeling the MACD on data2 code messes
up. It does not work completely (or not at all) on data2. But i have
no idea why it does not.....

greetings

Henry


------- macd stuff... where there might be an error... running on
data2 ----------


Input: FastMA(8), SlowMA(34), MACDMA(8);
vars: macdf(0), macds(0), macddif(0), macdtrend(False);

MACDf = XAverage(close, FastMA)data2 - XAverage(close, SlowMA)data2;
MACDs = xaverage(MACDf, macdma);
macddif = macdf - macds;

if macddif > macddif[1] then MACDTrend = true

else macdtrend = false;

if MACDTrend = true  (here follow some entry and exit conditions)

if MarketPosition = 0 then MACDTrend = False;