NexusFi: Find Your Edge


Home Menu

 





Setting Session Template with NinjaScript


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 
Ash669's Avatar
 Ash669 
Sydney,Australia
 
Experience: Advanced
Platform: Ninja Trader
Broker: Mirus/Zen-Fire
Trading: FOREX
Posts: 6 since Mar 2011
Thanks Given: 16
Thanks Received: 0

Hi everyone.

I need to be able to set the session template in my strategy code. This is unsupported by ninja trader.

I have read that "Session.String2Session(string session data)" is what I need to use. I am just a bit unsure as to how to use it.

Basically I have around 24 Session Templates that I want to optimize my strategy against and once I establish how to set the Session Template the rest of the coding I will be fine with. Any help would be appreciated.

Thanks

Ash


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Post-Summit Market Verdict: ES -1%, NQ -1.5%, 10-Year Yi …
Traders Hideout
Hormuz Normalization Collapses to 19.5% -- Iran Regime F …
Prediction Markets & Event Contracts
Beijing Summit Closes: Xi Pledges Hormuz Help -- $1.14B …
Prediction Markets & Event Contracts
Warsh Drops Easing Bias, December Hike Now Above 50% -- …
Prediction Markets & Event Contracts
Post-Summit Scorecard: $36M in May 15 Bets Settle Near-Z …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
13 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #3 (permalink)
 
Ash669's Avatar
 Ash669 
Sydney,Australia
 
Experience: Advanced
Platform: Ninja Trader
Broker: Mirus/Zen-Fire
Trading: FOREX
Posts: 6 since Mar 2011
Thanks Given: 16
Thanks Received: 0


I have now tried the following two bits of code. But still not working. Any help would be appreciated.

protected override void Initialize()
{
Session.String2Session("<Default 24/7>");
}

protected override void Initialize()
{
SessionData = "<Default 24/7>";
}


Started this thread Reply With Quote
  #4 (permalink)
 baruchs 
Israel
 
Experience: Intermediate
Platform: NinjaTrader
Broker: pfg
Trading: eminis
Posts: 323 since Jun 2009

// SessionData = "CME FX Futures ETH";
// SessionData = "<Use instrument settings>";
SessionData = "Default 24/7";


Reply With Quote
  #5 (permalink)
 
Ash669's Avatar
 Ash669 
Sydney,Australia
 
Experience: Advanced
Platform: Ninja Trader
Broker: Mirus/Zen-Fire
Trading: FOREX
Posts: 6 since Mar 2011
Thanks Given: 16
Thanks Received: 0


baruchs View Post
// SessionData = "CME FX Futures ETH";
// SessionData = "<Use instrument settings>";
SessionData = "Default 24/7";

Thanks for the response Baruchs. Have tried:

SessionData = "Default 24/7";

Still doesn't work. I have clarified this with:

if(CurrentBar == 1)
{
Print(Bars.Session.TemplateName);
}

???


Started this thread Reply With Quote




Last Updated on May 11, 2013


© 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