NexusFi: Find Your Edge


Home Menu

 





Strategy - Exclude First Bars Intraday


Discussion in EasyLanguage Programming

Updated
    1. trending_up 3,561 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 Airspace Collapses 18 Points to 15.5% While Hormuz …
Prediction Markets & Event Contracts
El Clasico Draws $9.2M in Prediction Market Action -- Bi …
Prediction Markets & Event Contracts
Iran Airspace Contract Surges to 33.5% as Project Freedo …
Prediction Markets & Event Contracts
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
Hungary Called for Magyar at 97pct, Ending 16-Year Orban …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
197 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
BERN ALGOS algo trading journal
8 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