Created indicator showing different result when used in a trading system
Forums › ProRealTime English forum › ProBuilder support › Created indicator showing different result when used in a trading system
- This topic has 5 replies, 2 voices, and was last updated 6 years ago by theo123.
-
-
05/21/2018 at 4:37 PM #71019
Hi all,
quite new in prorealtime and trying to slowly getting the hang of coding.
I recently created a code based on ichimoku and to make sure that my codes are correct I have created a “drawvlines” if the criteria matched hence considered to execute a buy.
what I found out is that there are 2 instances where are vertical lines in the chart but it was not executed and 1 that do not have vertical line but is executed.
ichimoku vlines12345678910111213141516171819202122//conversion----------------------------------------CONVERSION =(highest[9](high)+lowest[9](low))/2BASE =(highest[26](high)+lowest[26](low))/2//span AA =((conversion+base)[26])/2//span bh52=highest[52](high)l52=lowest[52](low)FUTurespanB =((h52+l52))/2B =FUTurespanB[26]//-----------------------------------------------//ABOVE OR BELOW//ConversionAboveCloud= conversion>max(A,B)B5a= CONVERSION crosses over BASE AND conversion>max(A,B)IF B5a THENdrawvline (barindex) COLOURED(255,0,255)endifreturnhere is the trading system
ichimoku buy12345678910111213141516171819202122//conversion----------------------------------------CONVERSION =(highest[9](high)+lowest[9](low))/2BASE =(highest[26](high)+lowest[26](low))/2//span AA =((conversion+base)[26])/2//span bh52=highest[52](high)l52=lowest[52](low)FUTurespanB =((h52+l52))/2B =FUTurespanB[26]//-----------------------------------------------//ABOVE OR BELOW//ConversionAboveCloud= conversion>max(A,B)B5a= CONVERSION crosses over BASE AND conversion>max(A,B)IF B5a THENBUY 1 CONTRACTS AT MARKETendifI removed all SL or TP just to really see how it is being executed. Hope anyone can help or point out what I did wrong.
thanks
05/22/2018 at 7:12 AM #71046You can try to debug with:
1GRAPH B5aThe boolean condition should then be plotted on your backtest chart. If it is true, then your order is launched. Just try to compare what this variable is returning both in the indicator and the strategy.
05/22/2018 at 7:55 AM #71052Thank you Nicolas. will sure try this once i get hold of my pc.
as a follow up though, would this also show the same number and time of open trades provided in the detailed report of the backtesting?
if yes, then if will just confirms the discrepancy of expected result using the same criteria/code for indicator and proorder.
05/22/2018 at 11:42 AM #71090You can try to debug with:
1GRAPH B5aThe boolean condition should then be plotted on your backtest chart. If it is true, then your order is launched. Just try to compare what this variable is returning both in the indicator and the strategy.
Hi Nicolas, the graph helps but actually an arrow up does show up for every buy position on my back test. if you can seen in my attachment, there is 1 with a buy arrow but no vline, while the 2 screenshots are without buy arrows but a vertical line showing inconsistency on handling the condition i set.
05/22/2018 at 1:15 PM #71095Yes, but you should first return the variables when you are debugging 🙂
So first from starting from B5a, if the trades are actually triggered if B5a>0, if yes, move on to next variables “B”, etc.. and compare it to indicator, and so on…
1 user thanked author for this post.
05/22/2018 at 4:41 PM #71120 -
AuthorPosts
Find exclusive trading pro-tools on