NexusFi: Find Your Edge


Home Menu

 





Trailing Stop Based on Swing High/Low


Discussion in MultiCharts

Updated
    1. trending_up 3,200 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

Trailing Stop Based on Swing High/Low

  #1 (permalink)
ClarkFX
Calgary + Alberta
 
Posts: 7 since Jul 2012
Thanks Given: 1
Thanks Received: 1

Hi guys, I'm trying to write a signal and I'm having troubles setting an initial stoploss as well as a trailing stop.

For long entries, I'd like the initial stop to be placed at the most recent swing low. For short entries, I'd like the initial stop to be placed at the most recent swing high.

As for the trailing stop, I'd like it to trail stops as a new swing low (long entries) or swing high (short entries) is formed.

The code that I have for long orders is:

If MarketPosition = 1 then begin

s_low = SwingLow(1, low, 2, 50);

Sell ("LE Stop") 1 contract next bar at s_low limit;

end;

Right now, that doesn't seem to be working at all, and I'm not really sure how else to go about it. I haven't found anywhere else that describes this. Any help would be appreciated.

Clark

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
67 thanks
NexusFi site changelog and issues/problem reporting
47 thanks
Battlestations: Show us your trading desks!
43 thanks
GFIs1 1 DAX trade per day journal
32 thanks
What percentage per day is possible? [Poll]
31 thanks

  #2 (permalink)
 
sptrader's Avatar
 sptrader 
Colorado
 
Experience: Advanced
Platform: MultiCharts
Broker: IB & Iqfeed
Trading: ES , CL
Posts: 535 since Apr 2010
Thanks Given: 1,097
Thanks Received: 701

Don't put a stop inside a "begin - end" statement..
Remove "Sell ("LE Stop") 1 contract next bar at s_low limit;" and put it after the "end" ;

Reply With Quote
  #3 (permalink)
ClarkFX
Calgary + Alberta
 
Posts: 7 since Jul 2012
Thanks Given: 1
Thanks Received: 1


So what should it look like? I'm not sure what you're saying.


Quoting 
If MarketPosition = 1 then
s_low = SwingLow(1, low, 2, 50);
Sell ("LE Stop") 1 contract next bar at s_low limit;

Like this you mean?

How come a begin, end will not work in this case?

Edit:

Just tried this, didn't work.

Thanks,
Clark

Reply With Quote





Last Updated on July 7, 2012


© 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