Tradeon error in algo
Forums › ProRealTime English forum › ProOrder support › Tradeon error in algo
- This topic has 1 reply, 2 voices, and was last updated 6 years ago by
robertogozzi.
Viewing 2 posts - 1 through 2 (of 2 total)
-
-
05/04/2019 at 11:58 AM #97669
Hi Robert Gozzi
I have written the code (first attempt) and would appreciate it if you could advise whether correct or not. (it still comes up with the “tradeon” error.
Here is the code:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697//————————————————————————-// Main code : wto32//————————————————————————-// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated// The system will cancel all pending orders and close all positions at 0:00. No new ones will be allowed until after the “FLATBEFORE” time.DEFPARAM FLATBEFORE = 080000// Cancel all pending orders and close all positions at the “FLATAFTER” timeDEFPARAM FLATAFTER = 165000// Prevents the system from creating new orders to enter the market or increase position size before the specified timenoEntryBeforeTime = 080000timeEnterBefore = time >= noEntryBeforeTime// Prevents the system from placing new orders to enter the market or increase position size after the specified timenoEntryAfterTime = 163000timeEnterAfter = time < noEntryAfterTime// Prevents the system from placing new orders on specified days of the weekdaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0ONCE WaitBars = 5ONCE TradeON = 1 //1=enable trading 0=disable tradingONCE Count = 0 //tallies bars as they elapse after a trade exitsIF Count > 0 THENCount = Count + 1 //tally bar after barENDIFIF Not OnMarket AND OnMarket[1] THEN //as soon as a trade exists start tallyingCount = 1 //set counter to 1 to start tallyingTradeON = 0 //disable tradingENDIFIF Count > WaitBars THEN //after desired number of bars elapsed reenable tradingCount = 0 //clear counterTradeON = 1 //enable tradingENDIF// Conditions to enter long positionsignored, ignored, ignored, ignored, ignored, ignored, ignored, indicator1 = CALL “PRC_WaveTrend Oscillator”c1 = (indicator1 >= 0)indicator2 = ADX[14]c2 = (indicator2 >= 20)indicator3 = ExponentialAverage[5](close)c3 = (close >= indicator3)IF (c1 AND c2 AND c3) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THENBUY 2 CONTRACT AT MARKETENDIF// Conditions to exit long positionsindicator4 = ExponentialAverage[5](close)c4 = (close <= indicator4)ignored, indicator5 = CALL “PRC_TAT”(close)c5 = (indicator5[1] <= indicator5)IF c4 AND c5 THENSELL AT MARKETENDIFONCE WaitBars = 5ONCE TradeON = 1 //1=enable trading 0=disable tradingONCE Count = 0 //tallies bars as they elapse after a trade exitsIF Count > 0 THENCount = Count + 1 //tally bar after barENDIFIF Not OnMarket AND OnMarket[1] THEN //as soon as a trade exists start tallyingCount = 1 //set counter to 1 to start tallyingTradeON = 0 //disable tradingENDIFIF Count > WaitBars THEN //after desired number of bars elapsed reenable tradingCount = 0 //clear counterTradeON = 1 //enable tradingENDIF// Conditions to enter short positionsindicator6 = ExponentialAverage[5](close)c6 = (close <= indicator6)indicator7 = ADX[14]c7 = (indicator7 >= 20)ignored, ignored, ignored, ignored, ignored, ignored, ignored, indicator8 = CALL “PRC_WaveTrend Oscillator”c8 = (indicator8 <=0)IF (c6 AND c7 AND c8) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THENSELLSHORT 2 CONTRACT AT MARKETENDIF// Conditions to exit short positionsindicator9 = ExponentialAverage[5](close)c9 = (close >= indicator9)ignored, indicator10 = CALL “PRC_TAT”(close)c10 = (indicator10[1] <= indicator10)IF c9 AND c10 THENEXITSHORT AT MARKETENDIF// Stops and targetsSET STOP pTRAILING 100Thank you in advance
05/04/2019 at 12:24 PM #97673If you DO NOT use TradeON you will ALWAYS been reported the same error message.
Replace line 45 with:
1IF (c1 AND c2 AND c3) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry AND TradeON THENand line 82 with:
1IF (c6 AND c7 AND c8) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry AND TradeON THENAt lines 24 and 61 you can remove ONCE.
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
Find exclusive trading pro-tools on
Similar topics: