NexusFi: Find Your Edge


Home Menu

 





Setting Session Template with NinjaScript


Discussion in NinjaTrader

Updated
    1. trending_up 3,002 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?
Fed Hike Odds at 57% After Warsh: England Surges 12.9%, …
Prediction Markets & Event Contracts
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
Warsh Drops Easing Bias, December Hike Now Above 50% -- …
Prediction Markets & Event Contracts
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
Thanks Mike. Godspeed.
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
Denied 20K payouts: Alpha Futures
1 thanks
FootPrintV2 Chart for NT8
1 thanks
BERN ALGOS algo trading journal
1 thanks
Afternoon-close session
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