Hi, looking for help
I’ve found following Code and i don’t know how to define the variables.
Maybee some one know it
// ma_cross_optimised
//works really well on 5 min ftse
//variable y, slow ma, 36,201,5
//variable x, fast ma, 2, 35 ,1
REM Buy
indicator1 = Average[x](close)
indicator2 = Average[y](close)
c1 = (indicator1 crosses over indicator2)
IF c1 THEN
BUY 100 shares AT MARKET nextbaropen
ENDIF
REM Sell
indicator3 = Average[x](close)
indicator4 = Average[y](close)
c2 = (indicator3 CROSSES UNDER indicator4)
IF c2 THEN
SELL AT MARKET nextbaropen
ENDIF
REM Short
indicator5 = Average[x](close)
indicator6 = Average[y](close)
c3 = (indicator5 CROSSES UNDER indicator6)
IF c3 THEN
SELLSHORT 100 shares AT MARKET nextbaropen
ENDIF
REM Exit short
indicator7 = Average[x](close)
indicator8 = Average[y](close)
c4 = (indicator7 CROSSES OVER indicator8)
IF c4 THEN
EXITSHORT AT MARKET nextbaropen
ENDIF
Hello Markus,
The indicator 1 to indicator 8 need x and y period that you must define somewhere in the code. Just place this 2 lines at the beginning of the code :
x = 21 //or whatever other period
y = 100 //or whatever