NexusFi: Find Your Edge


Home Menu

 





Strategy - Exclude First Bars Intraday


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
 Stevedee 
Idyllwild, CA
 
Experience: Intermediate
Platform: MetaTrader 5
Trading: Forex
Posts: 12 since Jul 2015
Thanks Given: 61
Thanks Received: 19

I'm working on a TS EL Strategy the uses, say, 5-, 10-, or 15-minute bars, or any intra-day length for that matter, but I don't want to allow any trades to take place until at least x number of bars after the Open have completed. I would like to backtest and have each day exclude those first x bars.

For example:

if "current_intra_day_bar" > x then begin;

Thanks for any help you can provide.

Steve


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
My Rant with AMP Futures
Trading Reviews and Vendors
No book, only a stair: journaling fills where price move …
Cryptocurrency
Trump Media to sell instant access to market-moving soci …
Traders Hideout
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
EA
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Mes vs MNQ
6 thanks
NexusFi site changelog and issues/problem reporting
5 thanks
BERN ALGOS algo trading journal
3 thanks
Johnnys Journal
2 thanks
TopStep Trader disappointment
2 thanks
  #3 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 691


Would something like this work for you?

 
Code
Variables:
	current_intra_day_bar(0);
	
if (current_intra_day_bar > 3) then begin

	// Submit the trades here

end;

// Reset the variable on the first bar of the day
if (Date <> Date[1]) then
	current_intra_day_bar = 0;

// Increment our counter variable on the close
// of each bar to count the bars
if (BarStatus(1) = 2) then 
	current_intra_day_bar = current_intra_day_bar + 1;
Here we add 1 to the variable on the close of each bar (to count the bars) and reset it at the start of trading every day.


Reply With Quote
Thanked by:
  #4 (permalink)
 Stevedee 
Idyllwild, CA
 
Experience: Intermediate
Platform: MetaTrader 5
Trading: Forex
Posts: 12 since Jul 2015
Thanks Given: 61
Thanks Received: 19

Thanks, that's a really good idea! I appreciate your help. I'll try to find time over the weekend to write your ideas in.

Steve


Started this thread Reply With Quote




Last Updated on August 14, 2015


© 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