NexusFi: Find Your Edge


Home Menu

 





Strategy - Exclude First Bars Intraday


Discussion in EasyLanguage Programming

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




 
Search this Thread

Strategy - Exclude First Bars Intraday

  #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?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
22 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


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


© 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