Forums › ProRealTime English forum › ProOrder support › Inconsistency (bug?) between ProBuilder and Proorder. Please advise. › Reply To: Inconsistency (bug?) between ProBuilder and Proorder. Please advise.
To further support the theory of an issue with BarIndex inconsistency between ProBuilder and ProOrder, I have done some more checks.
Using the formula for TR instead of the function in PRT as well as code provided by you Nicholas on Wilder smoothening code published in this forum, I can get identical results for most part between ProOrder and ProBuilder. This means there must be some inconsistency in the original function of the program. The only thing one has to take in account is to adapt the code with one bar less or more to represent the period one is looking at.
However, although hundreds of bars (including the first ones) are identical, I still find errors between some bars – see the marked boxed zone. In this case it is the Dow on the 1 minute chart. Error is on the second decimal, so it’s not the critical, but it is highly peculiar. Math is math. So it shouldn’t. It’s shouldn’t be a rounding error as it should happen on both the ProBuilder and ProOrder.
The code for ProBuilder:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
IF BarIndex = 0 THEN TRM = HIGH-CLOSE ELSIF BarIndex > 0 THEN TRM = MAX((HIGH-CLOSE), MAX(ABS(HIGH-CLOSE[1]), ABS(LOW-CLOSE[1]))) ENDIF N = 14 K = 1/N if barindex>N-1 then wilder = TRM * K + wilder[1] * (1-K) endif RETURN (wilder) |
The code I used for ProOrder based on:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
DEFPARAM PRELOADBARS = 0 IF BarIndex = 1 THEN TRM = HIGH-CLOSE ELSIF BarIndex > 1 THEN TRM = MAX((HIGH-CLOSE), MAX(ABS(HIGH-CLOSE[1]), ABS(LOW-CLOSE[1]))) ENDIF //TRMAV = average[14](TRM) N = 14 K = 1/N if barindex>N then wilder = TRM * K + wilder[1] * (1-K) endif GRAPH(wilder) //FAKE TRADING CONDITIONS BELOW // Conditions to enter long positions IF NOT LongOnMarket AND CLOSE>30000 THEN BUY 1 CONTRACTS AT MARKET ENDIF // Conditions to exit long positions If LongOnMarket AND CLOSE>40000 THEN SELL AT MARKET ENDIF // Conditions to enter short positions IF NOT ShortOnMarket AND CLOSE < 0.000001 THEN SELLSHORT 1 CONTRACTS AT MARKET ENDIF // Conditions to exit short positions IF ShortOnMarket AND CLOSE = 0 THEN EXITSHORT AT MARKET ENDIF // Stops and targets : Enter your protection stops and profit targets here |
For now I feel hesitant in launching real-money ATS as I can not verify what is going on with the code.
My queries are thus:
- Does ProOrder DEFPARAM PRELOADBARS = 0 mean no prior data before Bar=1 get loaded? Is there a hidden bar=0? How otherwise does the data pull occur from the previous close?
- Does ProBuilder reject using the Bar=0 even though it contains data?
- Why is BarIndex for ProOrder and ProBuilder not synced, one starts with Bar=1 (ProOrder) and one iwth Bar=0 (ProBuilder)
- Does this kind of inconsistency occur on “just” indicators / functions looking back at previous bars? Such as commands including [x] bar? These are quite a lot of functions (!)
- Are ProRealTime aware of these issues? I believe it can’t just be me noticing this?
Many thanks for your assistance.