How to use indicator in an strategy
Forums › ProRealTime English forum › ProOrder support › How to use indicator in an strategy
- This topic has 5 replies, 3 voices, and was last updated 6 years ago by Juan Salas.
-
-
11/21/2017 at 10:30 AM #53401
Hi colleagues,
I have been checking the PRT probuilder manual, and I need help to understand how to use an indicator into an strategy. There are many indicators that display pivotal points as arrows (x1,y1) and ellipses (x1, y1, x2, y2). It is very interesting for automatic trading to take this points (arrows) to place orders.
My question is how can I program a buy or sell order in reference to these points?
I have checked the blogs but I couldn’t find any reference about this. I would appreciate any links to this kind of information, or a brief example of a coded order.
Thanks in advance for any help,
Juan
11/21/2017 at 10:40 AM #5340611/21/2017 at 10:46 AM #53408Thanks Despair,
I have been trying to convert an indicator into an strategy, but when it comes to formulate the orders, I have to eliminate the drawing objects, and thus, I eliminate some of the conditions that create those drawings.
So I thought if would be easier to use the complete indicator and then the strategy “calling” the indicator, but the problem is what do you put into the buying order.
IF (x1,y1) THEN
BUY…
ENDIF
11/21/2017 at 11:02 AM #53415You must remove all drawing commands. The x-coordinate is usually the barindex and the y-coordinate is where you want to place your order (close crosses over Y1 or something like this).
2 users thanked author for this post.
11/21/2017 at 11:32 AM #53424After removing all graphic command, as Despair said, you may use the conditions that caused the command to be executed as your conditions in your strategy. Example (taken from a Candlestick pattern recognizer):
12345MorningStar=(body[2]<0 and body>0 and longcandle[2] and open[1]<close[2] and open>close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and low[1]<low and low[1]<low[2] and high[1]<open[2] and high[1]<close)if TrendDown[3] AND MorningStar thenDRAWTEXT("Morning Star", barindex, low[1]-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)DRAWARROWUP(barindex-1,low[1]) COLOURED(0,155,10)endifwhen embedded into your strategy will look like this:123456MorningStar=(body[2]<0 and body>0 and longcandle[2] and open[1]<close[2] and open>close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and low[1]<low and low[1]<low[2] and high[1]<open[2] and high[1]<close)if TrendDown[3] AND MorningStar then. //either go LONG or set other variables. //you know this the point where an arrow UP would have been drawn, so it's. //likely you have to go LONG hereendif3 users thanked author for this post.
11/21/2017 at 1:47 PM #53442Hi guys @Despair,@Roberto,
Thanks so much for your help,
That is what I did. I removed all graphics command from the code and replaced them with the order. If it said DRAWARROWUP I went LONG and such…
But in the case of the Indicator WILLIAMSHIGHANDLOW, removing the command DRAWELLIPSE, which it was a swing pivotal point of importance, disrupted the indicator and screwed the strategy code, since (x1,y1,x2,y2) was part of the code. But, knowing it is the way, I will do it that way.
Thanks so much for your help,
Juan
-
AuthorPosts
Find exclusive trading pro-tools on