NexusFi: Find Your Edge


Home Menu

 





Setting Session Template with NinjaScript


Discussion in NinjaTrader

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




 
Search this Thread

Setting Session Template with NinjaScript

  #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?
Exit Strategy
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Diary of a simple price action trader
26 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
22 thanks
My NQ Trading Journal
16 thanks
HumbleTraders next chapter
9 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


© 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