NexusFi: Find Your Edge


Home Menu

 





simple rolling feature including only data days / skipping non data days


Discussion in NinjaTrader

Updated
    1. trending_up 3,170 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)
 SARdynamite 
Belgium
 
Experience: Advanced
Platform: SaxoTrader
Broker: SaxoBank
Trading: ESTX
Posts: 289 since Dec 2009
Thanks Given: 243
Thanks Received: 110

Hello, we've debated about it on another thread.

Sometimes, the goal to avoid non data days, i.e. skipping, holidays, weekends and market closed days can be bothersome.

Here is a simple solution code snippet :

 
Code
if(CurrentBar<1) return;
            if (CurrentBar==1) j0=ToDay(Time[0]);
            if (ToDay(Time[0])>j0)
            {    
                if (Bars.FirstBarOfSession)
                {
                    if (j[1]<5) j.Set(j[1]+1);
                    else j.Set(1);
                }
                else j.Set(j[1]);
            }
            else j.Set(0);    
            }
This is aimed for intraday and simply detects (in this case), a rolling week of 5 session days marked 1 to 5 and evolving one after the other continuously.

This way you can assign specfic instructions to each 5 days with DataSeries and then work them together (sum them on specific day, compare them, etc)

Cheers


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ATFX Suspends Prop Trading Unit ATFunded -- Full Review …
Funded Trading Evaluation Firms
Peace Deal Forward Curve: May 22%, June 51%, December 81 …
Prediction Markets & Event Contracts
Victory Day Delivers: Russia-Ukraine Ceasefire Market Cl …
Prediction Markets & Event Contracts
S&P 500 Holds the Line: No Fast Track for SpaceX, Op …
Stocks and ETFs
The 50/50 Paradox: Peace and Invasion Each at 20% -- Ira …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
8 thanks
Darmok and Jalad at Tanagra
1 thanks




Last Updated on July 15, 2010


© 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