Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 7/6/2021(UTC) Posts: 1 Location: Coffs Harbour
|
Hi Guys, Just wanting to code in an ATR trailing stop into a system test. I have buy signals at oversold positions within a trend and the price action (for long trades) is generally either below the two-way ATR indicators I’ve tried, or the ATR indicator relies on manual input for buy date which doesn’t seem possible in the system tester.
I have had a play around with some code and can only get the trades to stop out if the price action has crossed above the coded ATR line and then returned. Basically, I think I need to hard code an ATR trailing stop into the sell order tab of the system tester but can’t work out how to reference the buy signal to commence the ATR plot. Any idea how I would do this? Thanks
Edited by user Friday, July 9, 2021 1:05:36 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,960
Thanks: 91 times Was thanked: 155 time(s) in 150 post(s)
|
Originally Posted by: Smeako1974 Hi Guys, Just wanting to code in an ATR trailing stop into a system test. I have buy signals at oversold positions within a trend and the price action (for long trades) is generally either below the two-way ATR indicators I’ve tried, or the ATR indicator relies on manual input for buy date which doesn’t seem possible in the system tester.
I have had a play around with some code and can only get the trades to stop out if the price action has crossed above the coded ATR line and then returned. Basically, I think I need to hard code an ATR trailing stop into the sell order tab of the system tester but can’t work out how to reference the buy signal to commence the ATR plot. Any idea how I would do this? Thanks
Hi, Per our formula writer, a logical switch is the way to accomplish this. Formula primer 2 https://www.metastock.com/customer/resources/formulas/primer.aspx explains how to do custom trailing stops but is a more advanced guide. You could also try the TradeTracker.dll. The help file gives the details on how to use this (Open F1 Help within MetaStock and use the Search tab for TradeTracker). If you are unable to get a more detailed answer here or would like direct assistance you can also submit a custom formula work request at https://www.metastock.com/customer/resources/formulas/customformulaform.aspx (There is a fee for this).
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.