function tradeOneNightStand() { vars SMA10 = series(SMA(seriesC(),10)); vars SMA40 = series(SMA(seriesC(),40)); Stop = 150 * PIP; Trail = 150 * PIP; TrailLock = 50; EntryTime = 24; int Days = LookBack; var BuyStop = HH(Days) + 1*PIP; var SellStop = LL(Days) - 1*PIP; if (dow() == FRIDAY && NumOpenLong == 0 && NumPendingLong == 0 && SMA10[0] > SMA40[0]) enterLong(0,BuyStop); else if (dow() == FRIDAY && NumOpenShort == 0 && NumPendingShort == 0 && SMA10[0] < SMA40[0]) enterShort(0,SellStop); if (dow() < FRIDAY) { exitLong(); exitShort(); } } function run() { BarPeriod = 60; LookBack = 13*24; StartDate = 2010; EndDate = 2015; while(asset(loop("USD/JPY", "GBP/USD", "EUR/USD"))) tradeOneNightStand(); } }
Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy
oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de