Incorrect Additional Order Entry
Forums › ProRealTime English forum › ProOrder support › Incorrect Additional Order Entry
- This topic has 9 replies, 3 voices, and was last updated 7 years ago by
random45689.
-
-
06/21/2017 at 1:30 PM #38740
Hi All
I am using the below code on a number of instruments for the last few days – this is a ‘semi-automatic’ strategy in that I manually start it when I consider the entry point then let it run the trade – it should only trade once and when the position is closed not enter any further trades
It has run succesfully (or unsuccesfully if you consider the ££’s lost!) on a few other instruments but running it just now half an hour ago or so it entered twice…! and lost me exactly £10.40 on both trades yet the entries were at different levels so how can that be possible…? (volatile spread? quite a coincidence no?)
I can’t work out why/how it has done this
I am running it on 1 second timeframe which could perhaps be the problem as IG support have told me in the past it takes at least 3 seconds for an order to process but this was a problem when I was entering/exiting immediately in other strategies on 1 sec timeframe – this is not the case here
Also attached picture of order entry
123456789101112131415161718192021222324252627282930313233343536373839404142434445//-------------------------------------------------------------------------// Main code : ONESHOT CPG BUY//-------------------------------------------------------------------------//DEFPARAM FLATAFTER = 204500//PARAMETERS BEGINONCE POSITIONSIZE=1ONCE SPREAD=5.4ONCE RISKPRICE=1674.2ONCE STOPLOSSPRICE=RISKPRICE-SPREADONCE ONETRADE=0//PARAMETERS END//TRADE ENTRY BEGINIF NOT ONMARKET AND ONETRADE=0 THENMAXPRICE=HIGHPRICEEXIT=STOPLOSSPRICEBUY POSITIONSIZE CONTRACT AT MARKETENDIF//TRADE ENTRY END//TRADEMANAGEMENT BEGINIF LONGONMARKET THENONETRADE=1TRAILINGSTOP=(TRADEPRICE(1)-STOPLOSSPRICE)MAXPRICE = MAX(MAXPRICE,HIGH) //saving the MFE of the current tradeIF MAXPRICE-TRADEPRICE(1)>=TRAILINGSTOP THEN //if the MFE is higher than the trailingstop thenPRICEEXIT= MAXPRICE-TRAILINGSTOP //set the exit price at the MFE - trailing stop price levelENDIFENDIF//TRADEMANAGEMENT END//TRADE EXIT BEGINIF ONMARKET THENIF CLOSE<STOPLOSSPRICE OR CLOSE<PRICEEXIT THENSELL AT MARKETENDIFENDIF//TRADE EXIT END//GRAPH TRAILINGSTOP//GRAPH PRICEEXIT//GRAPH STOPLOSSPRICE//GRAPH TRADEPRICE(1)//GRAPH MINPRICE(Also – it would be great if the columns auto-sized properly to show complete date columns! see ‘Closed position list’ date columns on attached picture – plenty of room to automatically size them properly and not have to do manually all the time!)
Cheers
Max
06/21/2017 at 1:44 PM #38744Just seen the Order List in PRT reports the two trade losses differently (picture attached) so assume the issue of both trades showing -£10.40 in the Performance Closed Position List is a bug/I don’t really care about that – I care about why did it enter the second trade! 🙁 🙁 🙁
06/21/2017 at 1:47 PM #38746The second entry took place immediatly after the first position has closed = normal behaviour. But a second trade should have not be triggered because of the notrade=0. Since you are declaring it at line 11, the only solution to debug this problem should be to delete this line. The “onetrade” variable is equal to 0 even if you are not declaring it (don’t need to declare variables in probuilder language).
06/21/2017 at 1:51 PM #38748Hi Nicolas
Thanks as ever for such a quick reply – hmmmm right ok… so delete line 11 as ONETRADE will be equal to zero even if it is not declared
Right ok but I thought the ONCE meant it was only processed once and never again…
I guess that is not the case/what is the point of ‘ONCE’ then..?
Anyway I will delete out line 11 and hopefully won’t happen again/all sorted
Cheers and thanks again for great help!
Max
06/21/2017 at 5:05 PM #3876406/21/2017 at 5:19 PM #38766Real – I’ve deleted the line now so yeh will update how I get on/if it happens again
It was a rapid drop when it happened/volatile but even still I don’t think it really should have happened but don’t care as only testing things out but if that was 10X or 100X position size I don’t think I would be so ‘cool’ about it 😉
Makes me think more and more to keep code simple simple simple!
1 user thanked author for this post.
07/14/2017 at 2:12 PM #40648Hi Nicolas
Apologies for yet again another long post I just can’t seem to condense things/too much to say!
I had not updated on here but basically I did have a problem running this code on a share (rather than indices as I have and still do run it on) where the strategy stopped with ‘This trading system was stopped due to an error’ but the position remained open with IG (whereas it should have closed the position at IG as per the PRT options)
ITF via IG are investigating and the latest I have heard from them is;
12/07/17 – “We are looking for clarification from the IT finance developers as to why the system was not stopped, according to our knowledge if a price can not be retrieved then that should fall under the category of a technical error and the strategy should stop.”
14/07/17 – “As far as the investigations go, they are still open and IT finance have not forgotten about them. I did ask them for clarification on why the system was not stopped as they are under the impression that it did stop. I asked them to check on the log to confirm that it did definitely not stop and what the setting was at the time.”
They were under the impression it stopped? I am not very happy with these chinese whispers between Me -> IG -> ITF but alas as an IG customer this is what we must endure but it makes for extremely tedious support cases…
HOWEVER – the reason I am replying now is that I have just had this strategy stop on EUR/USD with the ‘Broker cannot confirm status of last order’ (although I could see this in the ProOrder window clicking on the warning triangle it is NOT listed as an error in the Order List)
The price just spiked half an hour ago in my favour and that is when it failed
I have to say my live trials of using PRT trading with IG are not impressive and thankfully I have moved to extremely small position sizes but if these were larger there is obviously more than enough of a challenge making money trading let alone interoperability issues between the trading software platform and the broker that I am seriously reconsidering investing more time into PRT and feel would be better off just manually trading direct in the IG dashboard (much as I loathe the new interface…)
Many a theoretical conversation is had in these forums but I wonder how many are just using PRT as a charting platform (as the email I received from IG yesterday telling me about having to charge if not using/them saying something like “if you are only using PRT as a charting platform but trading with another broker get in touch with us to see how you can trade through us” (wow!) that not many are actually live trading and coming across these (to my mind extremely serious) issues…
Anyway rant over but yeh I’m just about ready to throw the towel in with PRT to be honest
07/14/2017 at 6:05 PM #40658They were under the impression it stopped? Yeah I flippin hate it too when folks give me bull like that (in any aspect of life!) Hello … did it stop or didn’t it??? And if you don’t know (IG / PRT) yet cos you not checked then just flippin say you (still) need to investigate … we’re not stupid and we don’t like our intelligence insulted!
Rant over, but seems we both ‘share a short fuse’ Max? 🙂
The Markets frustrate us enough without the added stress of trying to get Platform issues sorted … which will make for a better / more marketable product and so benefit IG / PRT in the long run?
If a company make’s sorting Issues through their technical support / customer service a tortuous frustrating experience then customers will stop reporting Issues. Companies then say things like … “We have not been made aware of that Issue by anybody else!”
Okay Rant really is over now, but I felt you needed some moral support MaxT.
GraHal
07/14/2017 at 6:37 PM #40659Cheers GraHal you’re absolutely right though am getting fed up with the run around by ITF – anyway not gonna start ranting it’s the weekend so have a good one! 🙂
07/21/2017 at 3:25 PM #41290Just received the following from IG;
21/07/17 – “There was an issue on PRT’s side where they could not get the price needed for this strategy, hence it got stopped, which is also why the position was not closed when the strategy was stopped.
Our apologies for the inconvenience of this.
Please let me know if you have further questions.”
Really not acceptable and it does not explain why the position was not closed – I will no longer be ploughing countless hours into constructing or using PRT strategies and am back to manual trading in the IG dashboard and only be using PRT for the charting/indicators
(that was about 3 weeks to get that feedback so not sure it would really count as a short fuse GraHal 😉 but yeh I’ve had enough now PRT strategies are too unreliable in my opinion)
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on