Code:
from stlib import *
import_csv_data("Kurse/dax")
def trendwecksel():
while strategie() == True:
d = get_date(1)
close = get_close(1)
ma = sma(200,0)
envo = ma * ( 1 + 1.5 / 100 ) # Envelopes upper indi bauen
envu = ma * ( 1 - 1.5 / 100 ) # Envelopes lower indi bauen
aup = aroon_up(9,1)
adown = aroon_down(9,1)
aroonoz = aup - adown
tv = total_volumen()
#--- Long ---
if close > envo and aroonoz > 50 and tv == 0:
buy_market(close)
if close < envu and aroonoz < 50 and tv == 1:
exit_long(close)
#---Short---
if close < envu and aroonoz < 50 and tv == 0:
sell_market(close)
if close > envo and aroonoz > 50 and tv == 1:
exit_short(close)
trendwecksel()