NexusFi: Find Your Edge


Home Menu

 





Need help with understanding breakout strategy code


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #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?
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
ATFX Suspends Prop Trading Unit ATFunded -- Full Review …
Funded Trading Evaluation Firms
Election Sunday Resolves: Peru Heads to Runoff at 42pct, …
Prediction Markets & Event Contracts
Powell in 48 Hours: Word Markets Give 78% on Inflation, …
Prediction Markets & Event Contracts
UMA Votes Tonight: Polymarkets $80M Strategy Bitcoin Bat …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #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


© 2026 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 - Downloads - Top
no new posts