Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to declair the Secondary Time Frame Instrument?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    how to declair the Secondary Time Frame Instrument?

    I am wondering if it's possible to add another Bars object for a different instrument to the script, where the instrument can be declared in Parameters field in Strategy Analyzer. I am trying something like this, it compiles fine, but doesn't work, when I launch Strategy Analyzer and try to select the strategy I am unable to select my strategy. Support please could you indicate me the correct way to do this?
    Code:
        #region Variables
    	private string cross 		= "$EURGBP";
        #endregion
    
    	protected override void Initialize()
    	{
        Add([B]cross[/B], PeriodType.Minute, 60); // BarsArray[1]
    	}
    	#endregion
    I noticed that it I change the instrument name in the Add() section to "$EURGBP" it works fine;
    Last edited by yades; 08-15-2013, 05:47 AM.

    #2
    yades, I would not expect either to work honestly, as the FX instruments would need to be prefaced by a $ sign, so please try with $EURGBP

    Comment


      #3
      Mine was a typo, I am already using $ infront. But my query was another: what syntax should i use in the add() field to be able to type different string value in the parameter section in market analyser?
      Originally posted by NinjaTrader_Bertrand View Post
      yades, I would not expect either to work honestly, as the FX instruments would need to be prefaced by a $ sign, so please try with $EURGBP

      Comment


        #4
        Oh ok, I see - to be able to make this a user input please check into this link - http://www.ninjatrader.com/support/f...ead.php?t=5782

        What you seek would be user input of type String.

        Comment


          #5
          Bertrand this doesnt help.
          I am trying to input a string value in the Add() field. Please read again my first post. Its all in there. My string varaible is declaired correctly, what i need to know is how to make it properly work in the Initialize() section
          Originally posted by NinjaTrader_Bertrand View Post
          Oh ok, I see - to be able to make this a user input please check into this link - http://www.ninjatrader.com/support/f...ead.php?t=5782

          What you seek would be user input of type String.

          Comment


            #6
            Alright, lets take it a step back, though you wanted more flexibility by not hardcoding the instrument in.

            Do you get any errors in the NT log tab running your script? Do you have a CurrentBars check in for both series?

            Comment


              #7
              All solved, i was missing the $ in the variable section, thanks for your help
              Originally posted by NinjaTrader_Bertrand View Post
              Alright, lets take it a step back, though you wanted more flexibility by not hardcoding the instrument in.

              Do you get any errors in the NT log tab running your script? Do you have a CurrentBars check in for both series?

              http://www.ninjatrader.com/support/h...ub=CurrentBars

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              651 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              370 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              109 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              574 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              577 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X