Trailing Stpos
Forums › ProRealTime English forum › ProOrder support › Trailing Stpos
- This topic has 9 replies, 5 voices, and was last updated 8 years ago by Daznic.
-
-
04/14/2016 at 9:18 AM #5362
I have a Trailing Stop built into my trading system and I trade via IG Markets. In the IG system there is an additional component when you enter a Trailing Stop which is the Step Level. This is in effect the amount that the price has to change before the Trailing Stop is triggered. In ProRealTime their is no Step Level so when an order is triggered automatically the Step Level used in the IG system is their minimum level for that market. Some of these Step Levels are much higher then I require, an example being EUR/SGD Mini Contract which is 50 when I want to use 10. Can anyone think of a method in ProRealTime to get around this?
04/14/2016 at 10:37 AM #5369It can be done programmatically, but you’ll have to create yourself a step variables that’ll test at each bar if the price met the conditions to make a new step or not. Then if the price goes below this step, you close the order (for a long trade) and vice-versa. Is this something that could handle what you want to do?
04/14/2016 at 3:05 PM #5387Nicolas,
Thanks for your response to my post. I think I understand the concept of what you suggest as a solution and I’m going to study how to program this. I will publish my results when I have something to show.
04/14/2016 at 8:05 PM #540805/02/2016 at 4:53 PM #6346Hi Nicolas,
I also have the same problem with Trailing Steps. You mention this can be done programmatically, i’d be very grateful if you could provide some pointers how to do this. I work with hourly bars, I can’t figure out how to get the current real-time price (tick by tick). This would allow one to compare current price against entryPrice and then move stop up/down accordingly.
Thanks
05/02/2016 at 6:52 PM #6354Hi, you can’t get real time tick per tick on hourly timeframe since conditions are only test once per bar.
As for Trailing stop with customize step, you can do this (example with only a one step move, but it could be adapted to a dynamic trailing easily)
1234567891011121314151617181920defparam cumulateorders = falsec1 = close>close[1]if c1 thenBUY 1 LOT AT MARKETSET STOP PLOSS 50endifIF NOT ONMARKET THENnewSL=0ENDIFIF LONGONMARKET AND close-tradeprice(1)>=30*pipsize THENnewSL = tradeprice(1)+5*pipsizeENDIFIF newSL>0 THENSELL AT newSL STOPENDIFIn this example, the stop loss is moved automatically at trade price open +5 points, for a long position, when the price has moved favourably 30 points above the open price.
05/02/2016 at 8:34 PM #636005/02/2016 at 8:49 PM #6361Thanks Nicolas, this is very useful code. Only problem for me is that I need to trail the price within an hourly bar as my strategy only uses a 1 hour bar.
I really hope ProBuilder supports real time pricing for all timeframes soon, currently it is a major blocker to getting strategies working correctly.
05/03/2016 at 8:02 AM #6376@Adolfo : you’re welcome! 🙂
@KeepGoingTrader: if you are placing a stop order to exit a position like in my previous code, this order will take place in the broker’s order book. So it will exit at exact price.05/03/2016 at 12:42 PM #6392 -
AuthorPosts
Find exclusive trading pro-tools on