NexusFi: Find Your Edge


Home Menu

 





Retrace before reentry?


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one jrh059 with 6 posts (0 thanks)
    2. looks_two SMCJB with 4 posts (2 thanks)
    3. looks_3 ABCTG with 4 posts (3 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 3,576 views
    2. thumb_up 5 thanks given
    3. group 3 followers
    1. forum 14 posts
    2. attach_file 0 attachments




 
Search this Thread

Retrace before reentry?

  #11 (permalink)
jrh059
Denver CO
 
Posts: 6 since Jul 2014
Thanks Given: 3
Thanks Received: 0

Yeah, I tried that and it gives me a max bars back error which doesn't make sense to me.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
NexusFi Journal Challenge - May 2024
Feedback and Announcements
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
Quant vue
Trading Reviews and Vendors
 
  #12 (permalink)
 
SMCJB's Avatar
 SMCJB 
Houston TX
Legendary Market Wizard
 
Experience: Advanced
Platform: TT and Stellar
Broker: Advantage Futures
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
Frequency: Many times daily
Duration: Never
Posts: 5,049 since Dec 2013
Thanks Given: 4,388
Thanks Received: 10,207

That's because of
 
Code
Lowest(Low, BarsSinceExit(1))

If barssinceexit > max bars back you'll get that error. I get around this problem (normally with barssinceentry) by using
 
Code
Lowest( Low, minlist(99, BarsSinceExit(1)) )

But obviously change 99 to whatever you need, it has to be less than your max bars back setting though.

Reply With Quote
Thanked by:
  #13 (permalink)
jrh059
Denver CO
 
Posts: 6 since Jul 2014
Thanks Given: 3
Thanks Received: 0


Yes, that part of the code is what's causing the error, but looking at the chart bar by bar, it should never be reaching my max bars back setting. There's something else in there jacking it up. When I reset the LongFalseStop to False, it will work for a few bars and then get stuck on false for the rest of the bars, causing no more entries to happen....hence the max bars back error.

Reply With Quote
  #14 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

jrh059,

you could track the lowest low yourself with a variable.

 
Code
if Low < trackLow then
    trackLow = Low ;
Assuming "trackLow" is the variable you created. After every exit you would simply reset it to the Low of the bar following your exit and from then on it will track any lower low.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #15 (permalink)
jrh059
Denver CO
 
Posts: 6 since Jul 2014
Thanks Given: 3
Thanks Received: 0

SO MANY THANKS TO YOU GUYS! Your help is very much appreciated! I have implemented elements of both of your advice and it is now working perfectly!

Reply With Quote




Last Updated on April 6, 2018


© 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