Found a EURUSD algo which I modified a bit.
It only takes short positions.
EURUSD 15 min Spread=1
Opitmized to 2018
// EURUSD 15 min
DEFPARAM CUMULATEORDERS = false
DEFPARAM FLATBEFORE = 100000
DEFPARAM FLATAFTER = 200000
positionsize=1
if time=140000 then
level=highest[2](low)[1]
endif
//
c1= close < dopen(0)
c2= high< dhigh(1)
c3= level > dlow(1) and level > dlow(2)
c4= (dclose(1)-dopen(1))/dopen(1)*100<0.65
ba= average[20](close)
dst = STD[20](close)
Bu = ba + (2 * dst)
c5= ba<ba[1] or high > bu
if c1 and c2 and c3 and c4 and c5 and time<130000 THEN
sellshort positionsize contract at market
endif
if shortonmarket and time=141500 and positionperf(0)*100<0.3 then
exitshort at market
endif
//trailing stop
trailingstop = 30
StartTrailingStopValue = 2
//resetting variables when no trades are on market
if not onmarket then
MAXPRICE = 0
MINPRICE = close
priceexit = 0
endif
//case SHORT order
if shortonmarket then
MINPRICE = MIN(MINPRICE,close) //saving the MFE of the current trade
if tradeprice(1)-close > StartTrailingStopValue*pointsize then
if tradeprice(1)-MINPRICE>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then
priceexit = MINPRICE+trailingstop*pointsize //set the exit price at the MFE + trailing stop price level
endif
endif
endif
//case LONG order
if longonmarket then
MAXPRICE = MAX(MAXPRICE,close) //saving the MFE of the current trade
if close-tradeprice(1) > StartTrailingStopValue*pointsize then
if MAXPRICE-tradeprice(1)>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then
priceexit = MAXPRICE-trailingstop*pointsize //set the exit price at the MFE - trailing stop price level
endif
endif
endif
//exit on trailing stop price levels
if onmarket and priceexit>0 then
EXITSHORT AT priceexit STOP
SELL AT priceexit STOP
endif
Hi Stefan
thanks for posting the code
I only have 100k bars but on my system it looks like the 15 minute outperforms on the first half of the year (no idea why)
I had a look at the 30 Minute chart that has a nice consistent trend, tested at 0.6 points as this is what I trade with on IG.com
Have you checked out the 30 minute timeframe? How does it look with 200k bars?
Thanks
Ruark
Robo did you reset times for UK UTC+0 as Stefan is on UTC+1?
Hi Graham
no I didn’t actually thanks for reminding me, with regards to a similar topic of day light savings time. Do you guys tend to use a different system or embed the change of timings for say a US based system?
Do you guys tend to use a different system or embed the change of timings for say a US based system?
I do neither! 🙂
I let the Systems run and they are out of sync by 1 hour for a few weeks until USA and EU align back again to the time difference (UTC -5, UTC +1 etc) when UK was on UTC +1 Summer Time.
Mmm but what if I develop a System in the winter when UK is on UTC+0 … need to think this one out! 🙂
It would be very very useful if each Member had their Timezone / Time Standard (in UTC + or – variance) against their Profile info which shows on each message they post.
I am forever googling Flags then googling what UTC + or – is correct for that Flag etc.
It could be that a lot of folks don’t bother or don’t remember and so they get different performance than the OP shows for their Systems etc??
Would above be a lot of work for you @Nicolas?
I know … I’ll check if there is a Flag to UTC Chart available that I can print out as a handy reference!?
PS Can’t find one … does anybody use anything similar?
What do you do … google the flag then google for the respective UTC variant?? 🙁
Just had another thought … how do we even know what Time Standard a Poster has his / her Platform set at!? They may not even be operating at their native UTC + or – ?
We all need to state / comment at the top of any System posted (Screeners also?) what UTC variance the code is intended for?
I should have posted these last 3 posts as a separate Thread.
Mods
Please could you move my last 3 posts to a separate Thread titled …
Declaring UTC Variance in System Codes
or a better title if you can think of one?
You are right GraHal, that would be better if everyone have this habit.. A better idea would be to display the UTC used directly on the backtest window result, I will add this feature request to my monthly list for PRT 🙂