Profile Picture

How to place a simple trailing stop?

Posted By ThomasZ 9 Years Ago
Message
Posted Saturday June 07 2008
Hello,

can someone please show me an example that shows how to place a simple trailing stop that takes the lowest low of the last 3 bars on a long position. Or if the way to implement it is principle the same then just a simple ATR TrailingStop.

I've searched for it but wasn't really successfully. Even also the examples that are delivered with the RE installation doesn't include a trailingstop. However, we all know how important a trailing stop is. Smile

Edited: Saturday June 07 2008 by ThomasZ
Posted Saturday June 07 2008
When you open a position, you can create a PositionSettings object, and set the TrailingStop and TrailingStopType properties.  This will cause the trailing stop to be created once the position is opened.  If you would like to create or modify the trailing stop for an existing position, you can use the PositionManager.SetTrailingStop method.  For example, to set a trailing stop of $1 on an existing position, you would use PositionManager.SetTrailingStop(pos.ID, 1, TargetPriceType.Price);  The trailing stop type can also be Percentage instead of price, but your broker may or may not support that if you are trading live.

Let us know if you need more help or a more detailed example.

Thanks,
Daniel

Posted Sunday June 08 2008
Thanks, this sounds very good.
Yes, sure, it would be great if you have an example. I think most other users would also be interested in a ready to use example.

Maybe it would be even a good idea to use the Crossover example that is delivered with the RightEdge installation and just add a simple trailing stop which takes previous low as stop. So it would be useful for all future beginners too.
What do you think?

Edited: Sunday June 08 2008 by ThomasZ
Posted Wednesday January 14 2009
Can trailing stops in paper broker (build 380) be used to BUY? I.e., can I specify a stop price above market that will follow a descending stock price and trigger a buy order when the prices rise above the stop price? I've tried to do this in a simple ATS, but could not get the desired behavior:

PositionSettings ps = new PositionSettings();
ps.OrderType = OrderType.TrailingStop;
ps.PositionType = PositionType.Long;
ps.TrailingStopType = TargetPriceType.Price;
ps.TrailingStop = 0.5;
pos = OpenPosition(ps);

When I do this, I expect a buy order to be filled as soon as the stock price exceeds the last minimu by $0.50. Perhaps I'm missing something, please educate me. Thanks!
Posted Thursday January 15 2009
Unfortunately this isn't currently supported.  You need to set the TrailingStop and the TrailingStop type on the order that is submitted to open the position, but the PositionSettings doesn't have properties for those values.  The TrailingStop properties on PositionSettings are for the trailing stop to be used after the position is opened.

Daniel

Posted Friday January 16 2009
Are there any plans to support this in the near future? Would be nice to have these advanced order types.
Posted Monday March 09 2009
Guys, any plans to add support for trailing stop buy orders in RE v.2? That would be uber useful! Seems like it shouldn't be hard if you already have trailing stop sells implemented.
Posted Tuesday March 10 2009
I don't think it's going to make the initial Ed 2 release, but this is likely something that will come in Ed 2 post builds.

Zora (3/9/2009)
Guys, any plans to add support for trailing stop buy orders in RE v.2? That would be uber useful! Seems like it shouldn't be hard if you already have trailing stop sells implemented.
Posted Monday March 23 2009
Is there a way to submit a TrailingStop close position order on OrderFilled that will activate at X% above the entry price and will trail Y% below that.

e.g. I bought ABC @ 100, I want that if it goes up 10% I will have a trailing stop of 1% less. So if it hits 110 a TrailingStop order should be activated with stop price of 109 (or is it 108.9? doesn't really matter for me)

I don't think I can use the default TrailingStop settings of the system because I want this order to be valid for one bar only, later every bar I re-evaluate the postion and decide if I want to resubmit the same order (for one more bar) or submit different (market/limit) order to close it.

I noticed there's some TrailingStop settings on OrderSetting object but am unsure of how to use them.

Thanks

phg
Supreme Being (44,623 reputation)Supreme Being (44,623 reputation)Supreme Being (44,623 reputation)Supreme Being (44,623 reputation)Supreme Being (44,623 reputation)Supreme Being (44,623 reputation)Supreme Being (44,623 reputation)Supreme Being (44,623 reputation)Supreme Being (44,623 reputation)
Posted Monday March 23 2009
The fact that the TrailingStop parameters can be set before a position is opened but then just don't work is one of those unwelcome 'surprises' that can waste a lot of time finding out about. I would encourage some attention to the problem.

-Pete

See also Yahoo group about applying RE.



Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems