Bespoke indicator / semi automated trading
Forums › ProRealTime English forum › ProBuilder support › Bespoke indicator / semi automated trading
- This topic has 15 replies, 5 voices, and was last updated 7 years ago by Big Hug.
-
-
02/24/2017 at 8:06 PM #26301
Hi all
Comments / amendments / suggestions welcome:
I’m trying to find a simple way around 1) not being able to use automated trading strategies coded and backtested with ProOrder with Interactive Brokers; and 2) not being able to have partial exits with IG. (I’m not an IG customer so don’t know if this bit is possible).
I thought of creating my own indicator with the buy or sell conditions and have it give a +1 for a buy or a -1 for a sell. Then set 2 alerts which can then be set and “forgotten” about. 1 alert for a buy (for when the indicator = 1) and 1 alert for a sell (indicator = -1). I’m not sure you can combine the two alerts although I’m happy to be told otherwise. You can have defined targets and stops for when the entry order is triggered.
Here is the simple code for the indicator (any suggestions or revisions to the code welcome):
123456789101112131415161718192021//Buy conditionsc1 = RSI[14](close) < 30c2 = (close > open)BuyOK = c1 AND c2//Sell conditionsc3 = RSI[14](close) > 70c4 = (close < open)SellOK = c3 AND c4Result = 0If BuyOK THENResult = 1ENDIFIF SellOK THENResult = -1ENDIFReturn ResultAttached is a screenshot of the alerts running on the Dow 15M futures. You can see beneath the price chart the new indicator “eg Conditions Test”. You can also see the 2 sets of pending orders on the price chart (waiting for the indicator to go to +1 or -1). Each has a target or 10 and a stop of 5 (although there seems to be a small lag in updating the orders when the current price moves).
The alerts are set up to trigger market orders at the end of the current bar (if a +1 or a -1). This is the same as the ProOrder engine?? However I do see that you can have the orders trigger real time. Idea is once an order is triggered and the target and stop is added you manually delete the opposite order (I don’t suppose this can be done automatically??). You can then be able to manually move the stop and target if you want. This is not an automated system as still requires trader input but at least you can set it up and work on something else.
Question: if this is used with IG could you then split the target into multiple targets?
Another question: should this work with Interactive Brokers (until we can trade fully automated strategies with them)?
And one more: is there a limit to how many or how complicated the conditions are within the indicator code?
Any thoughts appreciated. Thanks all, and happy weekend
1 user thanked author for this post.
02/24/2017 at 11:46 PM #26315Interesting / thought provoking!
Q1. If this is used with IG could you then split the target into multiple targets?
A1: Yes with a manual trade you could for example Buy 10 lots and then have 10 x 1 lot Limit orders as Exits.
Q2: Is there a limit to how many or how complicated the conditions are within the indicator code?
A2: No
On Manual, you can set up an ‘OCO Order’ … One Cancels the Other.
Can’t answer the question re IB, sorry.
Cheers
GraHal1 user thanked author for this post.
02/25/2017 at 10:21 AM #2632802/25/2017 at 2:35 PM #26342Hello jonjon,
concerning the partial exits: In an automated PRT trading system it is also possible:
1234567if buyingcondition thenbuy 2 contract at marketendifif sellingcondition and countofposition >1 thensell 1 contract at marketendif1 user thanked author for this post.
02/27/2017 at 9:50 PM #2661102/28/2017 at 12:50 AM #26620Hi Jonjon,
I’m running an RSI (live) based system using IG autotrade and have been doing so for about 3 months.
The results on are on Twitter, which I use as my “scrapbook” for convenience. If you put “Hughon” in the search and it should come up.With reference to your first point – why not just use IG . My Auto Trader (Ruby) enters the trade and puts in 20 point stops and targets.
It is been reliable and does as requested by the code.
I’m not sure of the merits of waiting for a signal and then manually triggering a trade for several reasons.
The first reason is that you have to be present (screen watching – I suppose you could call it). Isn’t this what the robot should be doing ?
(I could fill a book about why I’d like to auto trade ! My main issue with trading is “Time” and auto trading is a solution but that also presents
challenges ! = coding)
My second reason for using Auto trade is to try and achieve and measure “the system’s” effectiveness. At the moment, I try as best I can, not to fiddle with targets and stops.I can override it at any stage but need to remember to reset the auto trader if I do
as it will have stopped if I alter anything.With reference to your other point. I don’t understand why you need to cancel the other trade – being an RSI based system and surely you’d want to take the
Long or the Short. I find that bit a bit confusing.And finally – GraHal’s suggestion is a good idea – just create different AT codes with 5 – 10 – 20 point targets Long and Short.
A few closing ideas
– 15 mins seems like a long time frame to me – I run 1 min – 3 min and 5 min. I like the 3 & 5 min at the moment.
– Perhaps consider the auto trade to enter trades and place stops – exit manually …(just remember to reset).
– A point of interest : Last Wednesday FTSE 25.7 point dividend – there is no way of coding this in. The DOW and S&P have different dividend adjustments several times a week.
(I don’t trade DOW or S & P, so I’m not sure of the detail (See IG Twitter feed) so whilst you may see certain moves they may not all they appear after finance adjustments.)
– No auto trade will ever be perfect – but it will give you consistency.Hope this helps…a bit ! I’m still living with the Jonjon indicator BTW – I like it when it goes to ” 2 “
1 user thanked author for this post.
02/28/2017 at 10:47 AM #26659Hi Big Hug.
Thanks for your email. All good points. I’m now following you on Twitter. Just a few points:
- If I read your post correctly, Ruby enters a trade and enters at a predefined target? Is that right? So no partial exits? What I wanted was to explore a way of allowing partial exits on IG, and also to bring some automation (but not entirely automated) to IB.
- My understanding is that with IG if you enter a trade with a “fully” automated strategy with the ProOrder engine you can’t “turn the strategy off” mid trade to then manipulate the target and split it into partials??
- You do not manually enter the trades with my idea. You do need to set up the alert (which reads the indicator) and then you can have a cup of tea. As far as I’m aware you can only have one associated order with an alert with one target and one stop. However, I believe that IG (and IB) will consider this a manual entry. The idea is you can then split the target into partial targets which is not something you can do with strategies through the ProOrder engine.
- I only said that you would cancel the pending Sell order (assuming you went long to being with) just to clean things up and to minimise clutter on the chart whilst you have a position. I guess it is not 100% necessary.
Nicolas: I hope this helps to clarify my original post (I know I ramble on).
Will IG or IB count this as an automated strategy? Entry based on an alert which triggers based on a bespoke indicator? The indicator includes elements of a simple automated strategy within it (eg just the conditions).
02/28/2017 at 11:39 AM #2666502/28/2017 at 10:54 PM #2674803/01/2017 at 12:41 AM #26751- If I read your post correctly, Ruby enters a trade and enters at a predefined target? Is that right? So no partial exits? What I wanted was to explore a way of allowing partial exits on IG, and also to bring some automation (but not entirely automated) to IB.
- – Yes correct – preset targets of 20 points (I’m only trading FTSE). You could code in partial exits (coding) but I like to keep it simple & my trade size is not that big ATM LoL 🙂
- My understanding is that with IG if you enter a trade with a “fully” automated strategy with the ProOrder engine you can’t “turn the strategy off” mid trade to then manipulate the target and split it into partials??
- Sure you can do what you like – cancel or move targets or bring the stops up manually on the platform – it’s just that it will temporarily have “Stopped” the Auto Trader from running. When the trade is completed the Auto Trader just needs to be reset to “GO”. I suppose that’s why “Auto Trading is quite useful – it can enter a trade at more or less the right price point – set everything up (Stps & Lmts) – and then you have the option to work it from that point onwards if you wish to.
- As far as I’m aware you can only have one associated order with an alert with one target and one stop. However, I believe that IG (and IB) will consider this a manual entry. The idea is you can then split the target into partial targets which is not something you can do with strategies through the ProOrder engine.
- I was under the impression that the the “Associate Trigger” function didn’t create Stops or Targets automatically (it may be different on 10.3 – I’ve not spent that much time with it though). If I’m correct – that’s one of the drawbacks of Associate Triggers but they’re still useful …
03/02/2017 at 8:21 AM #26897Hi Big Hug
“– Yes correct – preset targets of 20 points (I’m only trading FTSE). You could code in partial exits (coding) but I like to keep it simple & my trade size is not that big ATM LoL :-)”
My understanding is that you can code partial exits and backtest them fine (which I have done) the problem is that you can’t use them with IG’s server which is the annoying part. Hence this was trying to get around that.
“Sure you can do what you like – cancel or move targets or bring the stops up manually on the platform – it’s just that it will temporarily have “Stopped” the Auto Trader from running. When the trade is completed the Auto Trader just needs to be reset to “GO”. I suppose that’s why “Auto Trading is quite useful – it can enter a trade at more or less the right price point – set everything up (Stps & Lmts) – and then you have the option to work it from that point onwards if you wish to. “
I didn’t know this. Very very useful. If you can then split the target into multiple orders then you have a solution to the problem of partials. Thanks for this info
03/03/2017 at 2:00 PM #2705203/04/2017 at 8:33 PM #27166@BigHug is below what you are referring to when you say My AutoTrader? If No, please might you provide a link?
https://www.ig.com/uk/desktop-trading-platform
Thanks
GraHal03/06/2017 at 12:42 PM #27317Apologies: I was distracted with other work last week and was distracted.
“@Jonjon BigHugs is referring to Auto Trader / Ruby when he mentions partial orders above, but I guess you knew that?”. I think I’m getting confused. I also think it is because I’m not signed up to IG yet. How I’m reading this now is that the “Auto Trader / Ruby” is an engine built through IG, not through the ProOrder engine on ProRealTime? If this is the case it sounds like you can have partials through the Auto Trader which I didn’t know but not through an automated strategy coded through ProOrder / ProRealTime?? Is this the case?
03/06/2017 at 1:01 PM #27322@jonjon you are not confused at all, you got it spot on correct!
I’m not sure what this Auto Trader is yet, I’m waiting for an answer from BigHug. I can’t find AutoTrader on IG, I think it’s available via Github and written in Ruby Code?? Pity I was looking forward to meeting Ruby! 🙂
-
AuthorPosts
Find exclusive trading pro-tools on