Hi, I've been playing with VJF for about a month now. I have experience in programmed in other languages and am getting the hang of VJF, but find that it often does things I neither expect of want it to do.
I have a very simple strategy that is based on the slope of an MA, plus come candlestick logic. The strategy takes the current MA value, MA value shifted by 1 and MA value shifted by 2. I thus derive the slope of the MA = MA shift 0 - MA shift 1 and the previous slope = MA shift 1 - MA shift 2.
I enter a long trade if current slope is positive and previous slope is negative and a short trade if current slope is negative and previous slope is position.
Hence it should only enter trades at turning points in the MA curve. However, the attached strategy sometimes open a long position when both current slope and previous slope are positive.
I've had some sucess coding around this using Boolean variables that enforce logic that says a long trade must follow a short trade, which must follow a long trade etc. This should be unnecessary, given the logic above is quite clear.
Any help on this would be appreciated.
regards chris
Attachments: |
HMA_20121206.vfs [45.12 KiB]
Downloaded 133 times
|
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on
this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control
on their content. Anyone accessing this webpage and downloading or otherwise making use of any document,
data or information found on this webpage shall do it on his/her own risks without any recourse against
Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from
the use and/or reliance on any document, data or information found on this webpage.
|
|