Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Instrument price quote without adding another series?

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

    Instrument price quote without adding another series?

    This may be a quirky question but I need to get a current bid or ask price of a currency pair in a strategy that does not use said currency pair for execution or any other runtime calculation.

    I don't want to add another series as I only need this during live trading. Is there a way to simply pull the current bid,ask,price of for instance the CAD/JPY without having to add another series that loads the entire chart length of the CAD/JPY? The price quote would only be used intermittently for position sizing. I hope this makes sense.

    #2
    Hello molecool,

    Without adding the instrument in question to the a Script I do not know of a way this may be done.

    Happy to be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_JC View Post
      Hello molecool,

      Without adding the instrument in question to the a Script I do not know of a way this may be done.

      Happy to be of further assistance.
      I was just thinking - since I only need a bid (or ask) during live trading: Couldn't I simply add a day series? Those get updated on a tick basis during live trading - so if I would query the day series when I need an accurate bid then I should be fine. Please correct me if I'm mistaken.

      So from there all I would need to do is this?

      Code:
      double cBid = GetCurrentBid(2) // - third bar series
      double cAsk = GetCurrentAsk(2) //- third bar series
      Last edited by molecool; 07-14-2013, 05:22 AM.

      Comment


        #4
        Hello molecool,

        Thank you for your response.

        All Period Types are updated in real-time if you have a real-time data feed provider.

        Using another bars object in your strategy means you will access it's values the same way as the other bars objects in your strategy. If you wish to call the Bid or Ask of that added series then your code appears to be correct based on the information you have provided.

        Please let me know if I may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        59 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        143 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        161 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        97 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X