NexusFi: Find Your Edge


Home Menu

 





Need help with understanding breakout strategy code


Discussion in EasyLanguage Programming

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




 
Search this Thread

Need help with understanding breakout strategy code

  #1 (permalink)
jsk123
Hyderabad,India
 
Posts: 88 since Oct 2013
Thanks Given: 44
Thanks Received: 21

I am reading a book on EasyLanguage and came across this code.

 
Code
Var: XX(1); //multiplier for average true range
Var:ATRval(15); //lookback period for ATR calculation

Buy next bar at close+XX*AvgTrueRange(ATRVal) stop;
Sellshort next bar at close-XX*AvgTrueRange(ATRVal) stop;
On every bar close...
this code creates a BUY STOP order and SELL STOP order slightly above and below the current bar close.

Imagine a situation where none of these price levels are hit and thus no long/short entry is taken... and we move on to the next bar....

Now... again... two STOP entry orders are placed above and below the most recent bar close...

My doubt is... What happens to the already pending STOP orders?
Are they cancelled automatically ?
Please help me understand this...

I'm unable to understand the code of these breakout type strategies...

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
NexusFi Journal Challenge - May 2024
Feedback and Announcements
Better Renko Gaps
The Elite Circle
 
  #2 (permalink)
jsk123
Hyderabad,India
 
Posts: 88 since Oct 2013
Thanks Given: 44
Thanks Received: 21

Ah!! Got it!

I found this in "Easy Language Essentials" book....

"The orders generated have a one bar duration and are cancelled if they are not filled by the end of next bar."

That solves the mystery!

If there is no fill then they are cancelled... Nice...

Reply With Quote




Last Updated on February 11, 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