VST Custom Strategy Lunar Cycle code
The following details will assist in placing the Lunar Cycle indicator within the VST Custom Strategy. (The VST Custom Strategy is FREE to download and use.)
This MetaStock indicator is available for free download from metastocklools.com . To download the indicator click here. (The code below is from the VSTpro template)
The code in all versions of the VST is open and able to be modified.
Click on images to enlarge.
-----------copy/paste code below this line---------------
{Full/New/Q1/Q3 Moon signals indicator Mk XV.
Buy: day before Q3
Sell: day before Q1
Trade at own risk!
Adj lunar signals to market's local Time Zone,
(generally add 1hr for Daylight Saving Time):
New Zealand: +12hrs
Australia: +10
Japan: +9
SE Asia: +8
Thai/Indonesia: +7
India: +5.5
Dubai: +4
Moscow: +3
Europe: +1
UK & Portugal: 0
USA, NY: -5
Chicago: -6
Copyright © 2001-2010 Jose Silva.
The grant of this license is for personal use
only - no resale or repackaging allowed.
All code remains the property of Jose Silva.
http://www.metastocktools.com }
{User inputs}
in:=Input("Entry: [0]NM [1]Q1 [2]FM [3]Q3",0,3,3);
ex:=Input("Exit: [0]NM [1]Q1 [2]FM [3]Q3",0,3,1);
TZ:=Input("Market's local Time Zone? [-12hrs to +12hrs]",-12,12,10);
shift:=Input("Advance signal by x calendar days",-30,30,-1);
{Lunar cycle length in days (synodic month)}
LunarMonth:=29.53059;
{Calendar engine}
y:=Year()-(Month()<3);
leap:=Int(y/4)-Int(y/100)+Int(y/400);
mth:=Int((2+153*(Month()-3+12*(Month()<3)))/5);
dayNr:=DayOfMonth()+mth+y*365+leap-657382
-4.86-TZ/24+shift;
{New/Q1/Full/Q3 Moon cycles}
NM:=Frac((DayNr+LunarMonth/2)/LunarMonth);
Q1:=Frac((DayNr+LunarMonth/4)/LunarMonth);
FM:=Frac(DayNr/LunarMonth);
Q3:=Frac((DayNr-LunarMonth/4)/LunarMonth);
{Lunar cycle signals}
cycle:=FM-NM;
FM:=cycle<0 AND Alert(cycle>0,2);
NM:=cycle>0 AND Alert(cycle<0,2);
cycle:=Q1-Q3;
Q1:=cycle<0 AND Alert(cycle>0,2);
Q3:=cycle>0 AND Alert(cycle<0,2);
{Entry conditions}
entry:=
If(in=0,NM,
If(in=1,Q1,
If(in=2,FM,
Q3)));
{Exit conditions}
exit:=
If(ex=0,NM,
If(ex=1,Q1,
If(ex=2,FM,
Q3)));
{Display}
entry-exit;
- If the VST Custom Strategy needs to be installed, the download link is located to the left of screen. (Check the VST is installed prior to the Custom Strategy)
- The VST Custom Strategy may be re-installed at any time to over-write any unwanted code.
- Copy/paste the code below into Windows Notepad, copy/paste the code from notepad into the VST Custom Strategy. (This ensures the code is pure text and clean)
- The charts below will assist in with entering the new code.
This MetaStock indicator is available for free download from metastocklools.com . To download the indicator click here. (The code below is from the VSTpro template)
The code in all versions of the VST is open and able to be modified.
Click on images to enlarge.
-----------copy/paste code below this line---------------
{Full/New/Q1/Q3 Moon signals indicator Mk XV.
Buy: day before Q3
Sell: day before Q1
Trade at own risk!
Adj lunar signals to market's local Time Zone,
(generally add 1hr for Daylight Saving Time):
New Zealand: +12hrs
Australia: +10
Japan: +9
SE Asia: +8
Thai/Indonesia: +7
India: +5.5
Dubai: +4
Moscow: +3
Europe: +1
UK & Portugal: 0
USA, NY: -5
Chicago: -6
Copyright © 2001-2010 Jose Silva.
The grant of this license is for personal use
only - no resale or repackaging allowed.
All code remains the property of Jose Silva.
http://www.metastocktools.com }
{User inputs}
in:=Input("Entry: [0]NM [1]Q1 [2]FM [3]Q3",0,3,3);
ex:=Input("Exit: [0]NM [1]Q1 [2]FM [3]Q3",0,3,1);
TZ:=Input("Market's local Time Zone? [-12hrs to +12hrs]",-12,12,10);
shift:=Input("Advance signal by x calendar days",-30,30,-1);
{Lunar cycle length in days (synodic month)}
LunarMonth:=29.53059;
{Calendar engine}
y:=Year()-(Month()<3);
leap:=Int(y/4)-Int(y/100)+Int(y/400);
mth:=Int((2+153*(Month()-3+12*(Month()<3)))/5);
dayNr:=DayOfMonth()+mth+y*365+leap-657382
-4.86-TZ/24+shift;
{New/Q1/Full/Q3 Moon cycles}
NM:=Frac((DayNr+LunarMonth/2)/LunarMonth);
Q1:=Frac((DayNr+LunarMonth/4)/LunarMonth);
FM:=Frac(DayNr/LunarMonth);
Q3:=Frac((DayNr-LunarMonth/4)/LunarMonth);
{Lunar cycle signals}
cycle:=FM-NM;
FM:=cycle<0 AND Alert(cycle>0,2);
NM:=cycle>0 AND Alert(cycle<0,2);
cycle:=Q1-Q3;
Q1:=cycle<0 AND Alert(cycle>0,2);
Q3:=cycle>0 AND Alert(cycle<0,2);
{Entry conditions}
entry:=
If(in=0,NM,
If(in=1,Q1,
If(in=2,FM,
Q3)));
{Exit conditions}
exit:=
If(ex=0,NM,
If(ex=1,Q1,
If(ex=2,FM,
Q3)));
{Display}
entry-exit;
VST Custom Strategy with the Lunar Cycle indicator.
Using the FREE VST Custom Strategy with the Lunar Cycle indicator the parameter can be changed to experiment and find the most profitable settings.
The VST Custom Strategy has no trend filter or stop-loss, these can be added with additional code.
This MetaStock indicator is available for free download from metastocklools.com . To download the indicator click here.
For further information on using Lunar Cycles as trading signals, " The Idiot & The Moon" website may be of interest.
Click on image to enlarge.
The VST Custom Strategy has no trend filter or stop-loss, these can be added with additional code.
This MetaStock indicator is available for free download from metastocklools.com . To download the indicator click here.
For further information on using Lunar Cycles as trading signals, " The Idiot & The Moon" website may be of interest.
Click on image to enlarge.
VSTpro Lunar Cycle indicator.
The VSTpro has a range of templates and the Lunar Cycle is included.
The chart below has the Lunar Cycle template applied, using the default settings, and the time zone adjusted to Australia.
This MetaStock indicator is available for free download from metastocklools.com. To download the indicator click here.
For further information on using Lunar Cycles as trading signals, " The Idiot & The Moon" website may be of interest.
Click on image to enlarge.
The chart below has the Lunar Cycle template applied, using the default settings, and the time zone adjusted to Australia.
This MetaStock indicator is available for free download from metastocklools.com. To download the indicator click here.
For further information on using Lunar Cycles as trading signals, " The Idiot & The Moon" website may be of interest.
Click on image to enlarge.
VSTpro testing stops on S&P500 charts.
VSTpro Band vs Market Trend Filter entry/exits
The charts below display the results after changing between the VSTpro Band and Market Trend Filter entry/exits.
The results of the changes are displayed in the stats. window to the left of the chart.
Further details on the value of using the Robust indicator click here.
ASX (XEJ)
Click on charts to enlarge.
ASX (XMJ)
Click on charts to enlarge.
ASX (XXJ)
Click on charts to enlarge.
- All charts have the VSTpro Long template applied.
- VSTpro SmartStop is active on all charts.
- The diagonal line on the Long Profit indicator, located just below the chart, was drawn freehand for demonstration purposes only.
The results of the changes are displayed in the stats. window to the left of the chart.
Further details on the value of using the Robust indicator click here.
ASX (XEJ)
Click on charts to enlarge.
ASX (XMJ)
Click on charts to enlarge.
ASX (XXJ)
Click on charts to enlarge.
VSTpro 2010/2011 sample trade results. (US stocks)
To view the complete sample trade table and explanation click here.
Subscribe to:
Posts (Atom)