NexusFi: Find Your Edge


Home Menu

 





Strategy - Exclude First Bars Intraday


Discussion in EasyLanguage Programming

Updated
    1. trending_up 3,641 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?
Iran Deal "In Review" at 87% on Deadline Day - …
Prediction Markets & Event Contracts
April CPI Preview: +3.7% YoY Expected at 8:30 AM ET -- C …
Traders Hideout
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
Thanks Mike. Godspeed.
The Elite Circle
Fabrication or Framework? Irans Denied MOU Explains the …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
15 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 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