NexusFi: Find Your Edge


Home Menu

 





Auto Trailing Stop Strategy


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one sandptrader with 8 posts (1 thanks)
    2. looks_two master trader with 3 posts (1 thanks)
    3. looks_3 traderlange with 1 posts (1 thanks)
    4. looks_4 Hansen with 1 posts (2 thanks)
      Best Posters
    1. looks_one Hansen with 2 thanks per post
    2. looks_two Daytrader999 with 2 thanks per post
    3. looks_3 traderlange with 1 thanks per post
    4. looks_4 master trader with 0.3 thanks per post
    1. trending_up 13,664 views
    2. thumb_up 9 thanks given
    3. group 10 followers
    1. forum 19 posts
    2. attach_file 7 attachments




 
Search this Thread

Auto Trailing Stop Strategy

  #11 (permalink)
 sandptrader 
Valdosta, GA. U.S.A
 
Experience: Advanced
Platform: Sierra , TOS
Trading: 6E, ES, CL, GC
Posts: 498 since Sep 2010
Thanks Given: 1,881
Thanks Received: 472

Here is another Trailing Stop Shell/Program
If anyone wants to work with this and try and see if it works reliably for Auto Trailing.
My Goal is to use any Program that would be Reliable for Auto Trailing your Stop, Preferably Parabolic Sar.
I have not found that Program yet, but wanted to post what i can find here at futures.io (formerly BMT) to see if i can get some help and maybe by way of a few folks Testing these Programs we could have a Decent Auto Trailing Stop for our Trading.
I have seen where i could have made so much more if i had this type program.
Anyone who wants to try these for Testing on Demo first and then make comments on their Reliability are welcome to Post.
Like i said before i am not a programmer, or do i know much at all about code, so i am asking for help.
One of these Programs may be what i am looking for to Trade GC & CL with an Auto Trailing Stop.
just now started to try an implement these into the platform, so i am a bit lost with using them.
Link to thread where i found this one, Post # 10.....https://nexusfi.com/ninjatrader-programming/3799-possible-trail-stop-per-parabolic-sar.html
Thanks for your help.

Attached Files
Elite Membership required to download: FDAX1LBtrail.zip
Elite Membership required to download: FDAX1LBtrail.cs
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Are there any eval firms that allow you to sink to your …
Traders Hideout
Futures True Range Report
The Elite Circle
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
65 thanks
Funded Trader platforms
41 thanks
Battlestations: Show us your trading desks!
29 thanks
NexusFi site changelog and issues/problem reporting
23 thanks
The Program
19 thanks

  #12 (permalink)
privacy8
Bogota, Cundinamarca, Colombia
 
Posts: 1 since Jul 2014
Thanks Given: 0
Thanks Received: 0

Hi,

I have programmed a trailing SAR stop for my strategy; i can modify it to suit your needs. Let me know if this still interests you.

Reply With Quote
  #13 (permalink)
 MrTrader 
ITAJAI SC/BRAZIL
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Clear Corretora
Trading: DOLFUT, WINFUT
Posts: 332 since Jun 2014
Thanks Given: 1,314
Thanks Received: 225


Hi @privacy8,

If you could share your trailing solution I think it would be useful for others.
@pepbosch is a user i know is looking for this kind of solution. He asked for this a few days ago on other thread (want your strategy created free)

Thank you and best regards,

Reply With Quote
Thanked by:
  #14 (permalink)
 traderlange 
NY NY
 
Experience: Advanced
Platform: NinjaTrader
Broker: Amp/CQG
Trading: Futures - CL/GC/YM
Posts: 42 since Aug 2011
Thanks Given: 31
Thanks Received: 209

I built a PSAR trail into this: might help?

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #15 (permalink)
Hansen
Freiburg, Germany
 
Posts: 1 since Apr 2012
Thanks Given: 1
Thanks Received: 1

You can add this to your strategy with the edit strategy wizard:

For Exit Long:
CrossAbove(SMA(ParabolicSAR(0.02, 0.2, 0.02),1),SMA(1),1)
This means, a 1 period SMA of the ParabolicSAR crosses above a standard 1 period SMA.

In the view code it looks like this:
// Condition set 2
if (CrossAbove(SMA(ParabolicSAR(0.02, 0.2, 0.02), 1), SMA(1), 1))
{
ExitLong("LoEx", "Lo");

Reverse for Short Exits:
// Condition set 4
if (CrossBelow(SMA(ParabolicSAR(0.02, 0.2, 0.02), 1), SMA(1), 1))
{
ExitShort("ShEx", "Sh");

This is my solution for the Trailing Stop with ParabolicSAR.

Reply With Quote
Thanked by:
  #16 (permalink)
 
master trader's Avatar
 master trader 
Calgary AB, Canada
 
Experience: Master
Platform: NinjaTrader
Broker: Zen-Fire
Trading: CL, GC, ZB
Posts: 124 since Apr 2010
Thanks Given: 43
Thanks Received: 41


Hansen View Post
You can add this to your strategy with the edit strategy wizard:

For Exit Long:
CrossAbove(SMA(ParabolicSAR(0.02, 0.2, 0.02),1),SMA(1),1)
This means, a 1 period SMA of the ParabolicSAR crosses above a standard 1 period SMA.

In the view code it looks like this:
// Condition set 2
if (CrossAbove(SMA(ParabolicSAR(0.02, 0.2, 0.02), 1), SMA(1), 1))
{
ExitLong("LoEx", "Lo");

Reverse for Short Exits:
// Condition set 4
if (CrossBelow(SMA(ParabolicSAR(0.02, 0.2, 0.02), 1), SMA(1), 1))
{
ExitShort("ShEx", "Sh");

This is my solution for the Trailing Stop with ParabolicSAR.


Many thanks.
Can you or anyone reading this do a similar solution using SuperTrend Trailing Stop instead of parabolic SAR. Will be much appreciated.

Reply With Quote
  #17 (permalink)
 
master trader's Avatar
 master trader 
Calgary AB, Canada
 
Experience: Master
Platform: NinjaTrader
Broker: Zen-Fire
Trading: CL, GC, ZB
Posts: 124 since Apr 2010
Thanks Given: 43
Thanks Received: 41


master trader View Post
Many thanks.
Can you or anyone reading this do a similar solution using SuperTrend Trailing Stop instead of parabolic SAR. Will be much appreciated.


@Hansen:

Don't worry about that. Turns out the plots are exposed in anaSuperTrend so I was able to do that myself. For anyone who may need the code here's how to add anaSuperTrend trailing stop to a Strategy.

//For Longs:

if (Position.MarketPosition == MarketPosition.Long && (anaSuperTrendU11(2, 1.5, 18, false, anaSuperTrendU11BaseType.Median, anaSuperTrendU11OffsetType.Default, anaSuperTrendU11VolaType.Simple_Range).StopDot[0] >= Close[0]))

{
ExitLong();
}


//For Shorts:

if (Position.MarketPosition == MarketPosition.Short && (anaSuperTrendU11(2, 1.5, 18, false, anaSuperTrendU11BaseType.Median, anaSuperTrendU11OffsetType.Default, anaSuperTrendU11VolaType.Simple_Range).StopDot[0] <= Close[0]))

{
ExitShort();
}



Don't forget to add the anaSuperTrend indicator to the chart.


Hope that helps.

Reply With Quote
Thanked by:
  #18 (permalink)
 KrazyTrader 
Dallas, TX/USA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES, CL
Posts: 51 since Aug 2013
Thanks Given: 56
Thanks Received: 9


master trader View Post
@Hansen:

Don't worry about that. Turns out the plots are exposed in anaSuperTrend so I was able to do that myself. For anyone who may need the code here's how to add anaSuperTrend trailing stop to a Strategy.

//For Longs:

if (Position.MarketPosition == MarketPosition.Long && (anaSuperTrendU11(2, 1.5, 18, false, anaSuperTrendU11BaseType.Median, anaSuperTrendU11OffsetType.Default, anaSuperTrendU11VolaType.Simple_Range).StopDot[0] >= Close[0]))

{
ExitLong();
}


//For Shorts:

if (Position.MarketPosition == MarketPosition.Short && (anaSuperTrendU11(2, 1.5, 18, false, anaSuperTrendU11BaseType.Median, anaSuperTrendU11OffsetType.Default, anaSuperTrendU11VolaType.Simple_Range).StopDot[0] <= Close[0]))

{
ExitShort();
}



Don't forget to add the anaSuperTrend indicator to the chart.


Hope that helps.

Thanks much. Will this create a server side stop (like trailing) or exit when the stop line breaks?

Thanks in advance.

Difference between discomfort and pain = 1 tick
Reply With Quote
  #19 (permalink)
 
master trader's Avatar
 master trader 
Calgary AB, Canada
 
Experience: Master
Platform: NinjaTrader
Broker: Zen-Fire
Trading: CL, GC, ZB
Posts: 124 since Apr 2010
Thanks Given: 43
Thanks Received: 41


KrazyTrader View Post
Thanks much. Will this create a server side stop (like trailing) or exit when the stop line breaks?

Thanks in advance.


I believe it works like OCO, it resides in your PC.

Reply With Quote
  #20 (permalink)
 George P 
Ath. Gr.
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES, 6E
Posts: 40 since Nov 2016



sandptrader View Post
The Chart shows the Trade and Parabolic Sar for Trailing.
Things to Consider would be as Follows:

- Platform Disconnects....what happens to the Trailing Stop or would there be any Stop Protection?
- would the Parabolic Sar Trailing Stop be Unwantedly Executed by way of either Bid/Ask quotes and not True
Executed Prices?
- Any other suggestions would be appreciated as this is ongoing project for me until i get this Strategy completed.

Hello sandptrader,

Interesting chart. I am mostly interested about the "line-type" oscillator (on the bottom of the chart). Is it possible for me to have it (download it or buy it) ? Or can you please tell me where can I find it ? I have developed similar (private) indicators of my own, but I would like to see yours as well. Thank you.

Reply With Quote





Last Updated on February 27, 2017


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts