Breakout Brent crudeoil "copy paste/adjusted"
- 32 - Brent.png
- 31 - IMAG0446-800x600.jpg
- 30 - brent-crude-5-min-1.jpg
- 29 - brent-crude-5-min.jpg
- 28 - brent-crude-v2.1.pdf
- 27 - brent-breakout.pdf
- 26 - brent-crude-updated-reiner-code-percent.jpg
- 25 - brent-crude-updated.jpg
- 24 - Brent-breakout.jpg
- 23 - Comparaison.png
- 22 - Brent-Breakout-5M.itf
- 21 - Brent-breakout-5M.jpg
- 20 - Brent-crude-V2.1-1.itf
- 19 - Brent-Crude-2.1-MM2.png
- 18 - Brent-Crude-2.1-MM1.png
- 17 - Brent-crude-V2.1.itf
- 16 - Brent-Crude-2.1-NOWEAD.png
- 15 - Brent-Crude-2.1-WE.png
- 14 - Brent-Crude-2.1-NOWE.png
- 13 - Brent-Crude-Original.png
- 12 - Capture.jpg
- 11 - walk-forward-5-step-70_30.jpg
- 10 - walk-forward-1-step-70_30.jpg
- 9 - overview.jpg
- 8 - brent-crude-updated.itf
- 7 - capital-curve.jpg
- 6 - Skärmavbild-2016-12-12-kl.-18.48.26.png
- 5 - breakout-5-min-brent.png
- 4 - brent-oil-trading-strategy.png
- 3 - temp.jpg
- 2 - Breakout-5min-BrentCrude-E1-1.itf
- 1 - Breakout-5-min-pic.png
12/10/2016 at 7:56 PM #18218
Here is a strategy copyed from here and adjusted for the brentcrude oil E1 5 min chart.
Any sugestions or coments are welcome.
Have not started it live since I whant to test it in V.10.3 PRT for IG users:)
12/11/2016 at 7:16 AM #18227
I uploaded the itf file then launched the strategy in 5 min on the LCO Crude Brent
I don’t have the same results as you, did I do something wrong ?
Reb12/11/2016 at 7:53 AM #18230
I checked a bit the code and I see some differences between the comments and the code :
// The position is closed at 9:45 p.m., local market time (France).
DEFPARAM FlatAfter = 225500
// No new position is taken after the candlestick that closes 5:15 p.m.
LimitEntryTime = 154500//154500
// The market analysis strats at the 15-minute candlestick which closes at 9:30 a.m.
StartTime = 151500
As french I have the time zone as you, why did did you mention 214500as comment and 225500 in your code ?
Could it be the reason of the big difference in term of results ?12/11/2016 at 10:08 AM #1823412/11/2016 at 10:55 AM #1823512/12/2016 at 7:33 AM #18265
I dont kow why results are different. Is probably somtheing with the timeframe to do.
I use 5 min chart 100 000units witch is max history for me.
Spread is 3.
STrategy starts 1515 and can not trade after 1545. (Norway local time) this has to be adjusted to your time Reb. Were are you from?
Position can be open to 21.45 or later, you can choose.
It also has Nicolas mef stop code witch I know works good in live trading(no bugs)12/12/2016 at 3:33 PM #1834112/12/2016 at 3:39 PM #1834212/12/2016 at 4:03 PM #1835112/12/2016 at 4:21 PM #1835412/12/2016 at 4:43 PM #18357
I also had a different result on default settings.
Try this code. I changed time and it did work for me.
Let me know if it changed for you.
Alco123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121// We don't load data before the start of the system.// As a result, if the system is started in the afternoon,// it will wait until the next day before placing any orders.DEFPARAM PreLoadBars = 0// The position is closed at 9:45 p.m., local market time (France).DEFPARAM FlatAfter = 235500// No new position is taken after the candlestick that closes 5:15 p.m.LimitEntryTime = 164500//154500// The market analysis strats at the 15-minute candlestick which closes at 9:30 a.m.StartTime = 161500// Some holidays such as the 24th and 31st of December are excludedIF (Month = 5 AND Day = 1) OR (Month = 12 AND (Day = 24 OR Day = 25 OR Day = 26 OR Day = 30 OR Day =31)) THENTradingDay = 0ELSETradingDay = 1ENDIF// Variables which can be adapted based on your preferencesPositionSize = 1AmplitudeMax = 80//58//80AmplitudeMin = 13//11//12OrderDistance = 4//4MinPercent = 35//30// We initialize this variable once at the beginning of the trading system.ONCE StartTradingDay = -1// The variables which can change during the day are initialized// at the beginning of each new trading day.IF (Time <= StartTime AND StartTradingDay <> 0) OR IntradayBarIndex = 0 THENBuyLevel = 0SellLevel = 0BuyPosition = 0SellPosition = 0StartTradingDay = 0ELSIF Time >= StartTime AND StartTradingDay = 0 AND TradingDay = 1 THEN// We store the index of the first bar of the trading dayIndexStartDay = IntradayBarIndexStartTradingDay = 1ELSIF StartTradingDay = 1 AND Time <= LimitEntryTime THEN// For each trading day, the highest and lowest price of the instrument// are recorded every 15 minutes since StartTime// until the buy and sell levels can be definedIF BuyLevel = 0 OR SellLevel = 0 THENUpperLevel = Highest[IntradayBarIndex - IndexStartDay + 1](High)LowerLevel = Lowest [IntradayBarIndex - IndexStartDay + 1](Low)// Calculation of the difference between the highest// and lowest price of the instrument since StartTimeDayDistance = UpperLevel - LowerLevel// Calculation of the minimum distance between the upper level and lower level// to consider a breakout of the upper or lower level to be significantMinDistance = DayDistance * MinPercent / 100// Calculation of the buy and sell levels for the day if the conditions are metIF DayDistance <= AmplitudeMax THENIF SellLevel = 0 AND (Close - LowerLevel) >= MinDistance THENSellLevel = LowerLevel + OrderDistanceENDIFIF BuyLevel = 0 AND (UpperLevel - Close) >= MinDistance THENBuyLevel = UpperLevel - OrderDistanceENDIFENDIFENDIF// Creation of buy and sell short orders for the day if the conditions are metIF SellLevel > 0 AND BuyLevel > 0 AND (BuyLevel - SellLevel) >= AmplitudeMin THENIF BuyPosition = 0 THENIF LongOnMarket THENBuyPosition = 1ELSEBUY PositionSize CONTRACT AT BuyLevel STOPENDIFENDIFIF SellPosition = 0 THENIF ShortOnMarket THENSellPosition = 1ELSESELLSHORT PositionSize CONTRACT AT SellLevel STOPENDIFENDIFENDIFENDIF// Definition of the conditions to exit the market when a// buying or selling position is open//////////////////////////////////////////////////////////////////////////////Trailing stop logikk////////////////////////////////////////////////////////////////////////////trailing stoptrailingstop = 45//15//resetting variables when no trades are on marketif not onmarket thenMAXPRICE = 0MINPRICE = closepriceexit = 0endif//case SHORT orderif shortonmarket thenMINPRICE = MIN(MINPRICE,close) //saving the MFE of the current tradeif tradeprice(1)-MINPRICE>=trailingstop*pointsize then //if the MFE is higher than the trailingstop thenpriceexit = MINPRICE+trailingstop*pointsize //set the exit price at the MFE + trailing stop price levelendifendif//case LONG orderif longonmarket thenMAXPRICE = MAX(MAXPRICE,close) //saving the MFE of the current tradeif MAXPRICE-tradeprice(1)>=trailingstop*pointsize then //if the MFE is higher than the trailingstop thenpriceexit = MAXPRICE-trailingstop*pointsize //set the exit price at the MFE - trailing stop price levelendifendif//exit on trailing stop price levelsif onmarket and priceexit>0 thenEXITSHORT AT priceexit STOPSELL AT priceexit STOPendif/////////////////////////////////////////////////////////////////Trailing stop logikk//////////////////////////////////////////////////////////////SET STOP ploss 55//5512/12/2016 at 4:48 PM #1835812/12/2016 at 4:54 PM #1836312/12/2016 at 4:58 PM #1836412/12/2016 at 4:59 PM #18365