Moving Average_ Shift Bugs

 

Hi,


This is Eldon.I am currently working on EA using Moving Average cross over to execute trade.

My program works. However, whenever i tried altering MA_SHIFT to negative number such as -1 instead of default 0, it does not work at all. Even for Strategy Back Tester..

May I know what are the possible solutions to this problem?

Merry Christmas..Thanks..


Best regards

 
silversilver:

Hi,


This is Eldon.I am currently working on EA using Moving Average cross over to execute trade.

My program works. However, whenever i tried altering MA_SHIFT to negative number such as -1 instead of default 0, it does not work at all. Even for Strategy Back Tester..

May I know what are the possible solutions to this problem?

Merry Christmas..Thanks..


Best regards


Hi SilverSilver,

For "Shift" - it's kind of contrary logic...

POSITIVE numbers are Past Bars (1 = previous bar, 2 = 2 bars past, etc)

NEGATIVE numbers are Future Bars - they don't exist... We all wish they did....lol!

Hope this helps,

Robert








 
cosmicbeing:

Hi, Thanks for the reply. However,the EA are unable to execute when i entered a negative number.

Why is it so? Any idea? =/


Best regards


Eldon




cosmicbeing:

 
silversilver:

Hi, Thanks for the reply. However,the EA are unable to execute when i entered a negative number.

Why is it so? Any idea? =/



Hi Eldon,

As I stated above.... Because the Future does not exist yet...??

We all have super indicators that we wish it could tell the next (future) bar...lol!

I hope this helps. Good luck with your efforts.

Robert