NexusFi: Find Your Edge


Home Menu

 





EasyLanguage - coding trailing stop below confirmed lows


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,827 views
    2. thumb_up 3 thanks given
    3. group 4 followers
    1. forum 18 posts
    2. attach_file 2 attachments




 
Search this Thread

EasyLanguage - coding trailing stop below confirmed lows

  #11 (permalink)
timfel
London, UK
 
Posts: 19 since Mar 2023
Thanks Given: 5
Thanks Received: 1


bfulks View Post
I am not sure I totally understand your description but this should be pretty close.

Bob Fulks

This certainly looks very close, thank you. I just need to get my head around exactly what it's doing, but graphically it looks pretty much there.

Thanks to all for their replies.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
REcommedations for programming help
Sierra Chart
NexusFi Journal Challenge - May 2024
Feedback and Announcements
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
48 thanks
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Bigger Wins or Fewer Losses?
24 thanks
Tao te Trade: way of the WLD
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
  #12 (permalink)
timfel
London, UK
 
Posts: 19 since Mar 2023
Thanks Given: 5
Thanks Received: 1


bfulks View Post
I am not sure I totally understand your description but this should be pretty close.

Bob Fulks

This looks very close, thank you. Can I ask where you got it from? They may have some more stuff that is useful.

Reply With Quote
  #13 (permalink)
 bfulks 
Boston MA
 
Experience: Advanced
Platform: TradeStation
Trading: Stocks and options
Posts: 24 since Aug 2022
Thanks Given: 2
Thanks Received: 4


I wrote it myself. Happy to help.

Reply With Quote
  #14 (permalink)
timfel
London, UK
 
Posts: 19 since Mar 2023
Thanks Given: 5
Thanks Received: 1


bfulks View Post
I wrote it myself. Happy to help.

Wow, very impressive, thank you!

It doesn’t do quite what I want, but I’m hopeful I can use it as a guide to creating what I do want.

In the long case, I am looking to code a trailing stop based on the most recent low.

For me, an up move persists for as long as each candle takes out the high of the preceding candle. When a candle fails to take out the high of the preceding candle, in my definition, this is the start of the pullback.

When that previous high is taken out, then the pullback is over, and the most recent low is the lowest point between the previous high, and the point where it was taken out.

Sometimes the pullback is just one candle so the most recent low is simply the low of that candle.

I know this is perhaps a slightly unusual way to define structure, but for me (trading M5 and M15), this exit has given the best results of any method I’ve tested.

It seems to be impossible to code though (for me at least!).

Reply With Quote
  #15 (permalink)
 bfulks 
Boston MA
 
Experience: Advanced
Platform: TradeStation
Trading: Stocks and options
Posts: 24 since Aug 2022
Thanks Given: 2
Thanks Received: 4

Can you tell me what it is about pictures I posted with the code that is not what you need?

Reply With Quote
  #16 (permalink)
timfel
London, UK
 
Posts: 19 since Mar 2023
Thanks Given: 5
Thanks Received: 1


bfulks View Post
Can you tell me what it is about pictures I posted with the code that is not what you need?

Sure (and thanks for your interest!).

It’s not quite spotting the most recent lows by my rules. Taking the last one at 467 as an example, rather than the low being the low of the big red candle, it would actually be the low of the green candle two bars back, because the bar before that failed to take out the high of the previous candle, which means it is the start of the pullback. Then the green candle made a lower low before the following red candle took out the high, indicating the pullback is over.

The low is the lowest point between the old high (red candle 3 bars after the run of green candles), and the new high which took that out. In this case, it’s the low of the green, round about 475.

If that’s not clear, I’ll try to sketch it out.

Many thanks,

Tim

Reply With Quote
  #17 (permalink)
 bfulks 
Boston MA
 
Experience: Advanced
Platform: TradeStation
Trading: Stocks and options
Posts: 24 since Aug 2022
Thanks Given: 2
Thanks Received: 4

I think I see the problem. It seems to get hung-up in certain conditions.

I fixed it by adding one line of code at line 20.

See the attached picture and EasyLanguage code.

Bob

Attached Files
Elite Membership required to download: TrailingStop.2.pdf
Reply With Quote
Thanked by:
  #18 (permalink)
timfel
London, UK
 
Posts: 19 since Mar 2023
Thanks Given: 5
Thanks Received: 1

Fantastic, thanks Bob. I’ll try this out when I get home on Monday morning.

Reply With Quote
  #19 (permalink)
timfel
London, UK
 
Posts: 19 since Mar 2023
Thanks Given: 5
Thanks Received: 1


bfulks View Post
I think I see the problem. It seems to get hung-up in certain conditions.

I fixed it by adding one line of code at line 20.

See the attached picture and EasyLanguage code.

Bob

Yes that worked, thanks!

Reply With Quote




Last Updated on June 13, 2023


© 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