Code did not trigger in live environment
Forums › ProRealTime English forum › ProOrder support › Code did not trigger in live environment
- This topic has 4 replies, 4 voices, and was last updated 6 years ago by
adeelq79.
-
-
11/04/2019 at 11:08 PM #112124
Hi, I wrote a code which works on back test and shows an entry for today, but it did not trigger in the live environment. It has worked previously so not sure what is wrong.
Also, I am unsure if the stop to break even code is correctly working. For example, today it rose +13 and then fell back. The stop to break even code should have kept +6 points.
Any ideas if something looks wrong in this code?
Thanks for the help.
Market = FTSE100 on 1 hour time frame.
FTSE 100 - 1 Hour Time Frame12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivatedOnce LastTradeDate = 0// Prevents the system from creating new orders to enter the market or increase position size before the specified timenoEntryBeforeTime = 090000timeEnterBefore = time >= noEntryBeforeTime// Prevents the system from placing new orders to enter the market or increase position size after the specified timenoEntryAfterTime = 160000timeEnterAfter = time < noEntryAfterTime// Prevents the system from placing new orders on specified days of the weekdaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0//how much pips/points in gain to activate the breakeven function?startBreakeven = 11//how much pips/points to keep in profit above or below our entry price when the breakeven is activated (beware of spread)PointsToKeep = 6// Conditions to enter long positionsindicator1 = RSI[7](close)c1 = (indicator1 >= 83)ignored, ignored, ignored, ignored, indicator2, ignored, ignored = CALL "WA Explosion COMBO"[150, 30, 15, 15]c2 = (indicator2 >= 260)indicator3 = ExponentialAverage[5](close)indicator4 = ExponentialAverage[17](close)c3 = (indicator3 > indicator4)indicator5 = ExponentialAverage[62](close)indicator6 = ExponentialAverage[5](close)c4 = (indicator5 < indicator6)IF (c1 AND c2 AND c3 AND c4) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry AND LastTradeDate<>OpenDate THENBUY 1 CONTRACT AT MARKETLastTradeDate = OpenDateENDIF// Conditions to enter short positionsindicator7 = RSI[7](close)c5 = (indicator7 <= 22)ignored, ignored, ignored, ignored, ignored, indicator8, ignored = CALL "WA Explosion COMBO"[150, 30, 15, 15]c6 = (indicator8 >= 260)indicator9 = ExponentialAverage[5](close)indicator10 = ExponentialAverage[17](close)c7 = (indicator9 < indicator10)indicator11 = ExponentialAverage[62](close)indicator12 = ExponentialAverage[5](close)c8 = (indicator11 > indicator12)IF (c5 AND c6 AND c7 AND c8) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry AND LastTradeDate<>OpenDate THENSELLSHORT 1 CONTRACT AT MARKETLastTradeDate = OpenDateENDIF// Stops and targetsSET STOP pLOSS 45SET TARGET pPROFIT 30//reset the breakevenLevel when no trade are on marketIF NOT ONMARKET THENbreakevenLevel=0ENDIF// --- BUY SIDE ---//test if the price have moved favourably of "startBreakeven" points alreadyIF LONGONMARKET AND close-tradeprice(1)>=startBreakeven*pipsize THEN//calculate the breakevenLevelbreakevenLevel = tradeprice(1)+PointsToKeep*pipsizeENDIF//place the new stop orders on market at breakevenLevelIF breakevenLevel>0 THENSELL AT breakevenLevel STOPENDIF// --- end of BUY SIDE ---// --- SELL SIDE ---IF SHORTONMARKET AND tradeprice(1)-close >= startBreakeven*pipsize THEN//calculate the breakevenLevelbreakevenLevel = tradeprice(1)-PointsToKeep*pipsizeENDIF//place the new stop orders on market at breakevenLevelIF breakevenLevel>0 THENEXITSHORT AT breakevenLevel STOPENDIF// --- end of SELL SIDE ---11/04/2019 at 11:50 PM #11213111/05/2019 at 11:46 AM #112185Vonasi … shhhh whisper … it’s still in the ProBuilder Forum! 🙂
2 users thanked author for this post.
11/05/2019 at 1:46 PM #112203Apart that we don’t know what is included in the “WA Explosion COMBO” indicator, I do not see any error in the code.
For the missed breakeven order, look at rejected orders list, the price could have been too close to the actual price due to slippage.
11/05/2019 at 11:31 PM #112239 -
AuthorPosts
Find exclusive trading pro-tools on