Smoothed Bollinger% Strategy Daily_Topic
Forums › ProRealTime English forum › ProOrder support › Smoothed Bollinger% Strategy Daily_Topic
- This topic has 91 replies, 15 voices, and was last updated 3 years ago by robertogozzi.
-
-
02/04/2018 at 11:24 AM #6141002/04/2018 at 11:34 AM #6141102/04/2018 at 6:25 PM #6146702/04/2018 at 6:40 PM #6147002/04/2018 at 6:46 PM #6147302/04/2018 at 10:51 PM #61500
I´m not sure why it´s happening. I´ve gone through the code many times now and can´t find anything that differates from lets say an 1 hour code that isn´t stopping it self.
My highly non certain conclusion is that it has something to do with IGs pricing.
Mon-Thurs = 1 candle – 24 hours, Fri=1 caandle – 22 hours. I think that´s messing up the code since it can´t read the price when it thinks it should be able to and thats why there´s an error and prt trying to quit the code.
Now my position has closed and I have (as you can see in the picture below) three rejected orders that says=
First rejection = This market is now closed
Second rejection = Sorry, we have been unable to confirm the status of your trading request. Please call us on …..
Third Redjection= Price is no longer available
1 user thanked author for this post.
02/05/2018 at 12:24 PM #61540Ok, now I´m going to dubbelpost again… But I really like this code so I want it to work 🙂
With my limited coding skills this is the only thing I can think of changing (code). No new position on fridays and closes open positions on friday opening.1234567891011121314151617181920212223242526272829303132333435363738//--------------------------------------------------------------------------------------------------//daysnotfd = opendayofweek = 1 or opendayofweek = 2 or opendayofweek = 3// STRATEGY//--------------------------------------------------------------------------------------------------IF NOT LongOnMarket AND avgFilterEnterLong AND SvEFilterEnterLong and notfd THENBUY 1 CONTRACT AT MARKETENDIFIF NOT ShortOnMarket AND avgFilterEnterShort AND SveFilterEnterShort and notfd THENSELLSHORT 1 CONTRACT AT MARKETENDIFIF POSITIONPERF<0 THENIF LongOnMarket AND BARINDEX-TRADEINDEX(1)>= barLong THENSELL AT MARKETENDIFENDIFIF POSITIONPERF<0 THENIF shortOnMarket AND BARINDEX-TRADEINDEX(1)>= barshort THENEXITSHORT AT MARKETENDIFENDIFif opendayofweek = 4 and openhour = 21sig=1elsesig=0endifIF sig=1 THENSELL AT MARKETEXITSHORT AT MARKETENDIF02/05/2018 at 1:13 PM #61543have you already had this strategy open of Friday? It could be a case that is not rarely verified.
I have other strategies with the same code on the indexes and this it happens only rarely me on the European indexes. But I never work on forex.02/05/2018 at 1:23 PM #61546I had it this friday. Maybe it wont happen again or it will, I dont know but its pretty annoying if it closing a loosing trade that would have been a winner if it was hold over the weekend.
Personally I´m fine with this addition to the code since I don´t like to have FX positions open during NFP, I like trend more than volatility.
When I have experineced this problem in the past it has always been on OMX (Sweden 30).
02/05/2018 at 1:31 PM #61550To avoid volatily days please consider it:
123456789101112131415161718192021222324252627282930once countFridays = 0firstDayOfMonth = (day = 1)isFriday = (dayOfWeek = 5)firstWeek = (day < 8)if firstDayOfMonth thencountFridays = 0endifif isFriday and (not isFriday[1]) thencountFridays = countFridays + 1endif// Non Farm PayrollsnfpDay = isFriday and firstWeek// Triple WitchingisMarch = (Month = 3)isJune = (Month = 6)isSept = (Month = 9)isDec = (Month = 12)tripleWitchingMonth = isMarch or isJune or isSept or isDecthirdFriday = isFriday and countFridays = 3tripleWitching = thirdFriday and tripleWitchingMonth//////////////////////////////////////////////////////////IF nfpday or tripleWitching thensell at marketexitshort at marketendif02/05/2018 at 1:39 PM #61552NFP & TRIPLEWITCHING INDICATOR123456789101112131415161718192021222324252627once countFridays = 0firstDayOfMonth = (day = 1)isFriday = (dayOfWeek = 5)firstWeek = (day < 8)if firstDayOfMonth thencountFridays = 0endifif isFriday and (not isFriday[1]) thencountFridays = countFridays + 1endif// Non Farm PayrollsnfpDay = isFriday and firstWeek// Triple WitchingisMarch = (Month = 3)isJune = (Month = 6)isSept = (Month = 9)isDec = (Month = 12)tripleWitchingMonth = isMarch or isJune or isSept or isDecthirdFriday = isFriday and countFridays = 3tripleWitching = thirdFriday and tripleWitchingMonth//////////////////////////////////////////////////////////return tripleWitching COLOURED (200,0,0) STYLE(HISTOGRAM) AS "WHICH" ,nfpDay COLOURED (100,0,0) STYLE(HISTOGRAM)AS "NFP"1 user thanked author for this post.
02/05/2018 at 4:21 PM #6157602/05/2018 at 7:01 PM #6158202/06/2018 at 2:04 PM #6169502/06/2018 at 2:14 PM #616991234567891011121314151617181920212223242526272829303132333435//-----------------------------------------------------------------------------------------------//daysnotfd = opendayofweek = 1 or opendayofweek = 2 or opendayofweek = 3// STRATEGY//--------------------------------------------------------------------------------------------------IF NOT LongOnMarket AND avgFilterEnterLong AND SvEFilterEnterLong and notfd THENBUY 1 CONTRACT AT MARKETENDIFIF NOT ShortOnMarket AND avgFilterEnterShort AND SveFilterEnterShort and notfd THENSELLSHORT 1 CONTRACT AT MARKETENDIFIF POSITIONPERF<0 THENIF LongOnMarket AND BARINDEX-TRADEINDEX(1)>= barLong THENSELL AT MARKETENDIFENDIFIF POSITIONPERF<0 THENIF shortOnMarket AND BARINDEX-TRADEINDEX(1)>= barshort THENEXITSHORT AT MARKETENDIFENDIFif opendayofweek = 4 and openhour = 21 THENIF POSITIONPERF>0 THENSELL AT MARKETEXITSHORT AT MARKETENDIFENDIFYOU CAN CONSIDER TO TEST IF IT’S BETTER TO CLOSE IT IF POSITION IT’S IN PROFIT OR NOT
-
AuthorPosts
Find exclusive trading pro-tools on