Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add forex data series

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

    Add forex data series

    I have tried and looked everywhere on the forum I cant find anyone having the same problem I am. How do I add a forex series to an indicator and then plot the lastest price in the oscillator? I have tried many futures series and works just fine but when go to forex it plots nothing. I have tried the following:

    Add("EURUSD", PeriodType.Minute, 1);
    Add("@EURUSD", PeriodType.Minute, 1);
    Add("$EURUSD", PeriodType.Minute, 1);

    please help

    thank you

    #2
    code

    protected override void Initialize()
    {
    Add("EURUSD", PeriodType.Minute, 1);
    Add(new Plot(Color.Green, "Arbitage"));
    Overlay = false;
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {

    if (BarsInProgress == 1)
    {
    euru = Close[0];
    }

    Value.Set(euru);
    // Use this method for calculating your indicator values. Assign a value to each
    // plot below by replacing 'Close[0]' with your own formula.
    }



    not sure why this code isn't working

    Comment


      #3
      Hello bradc343,

      Thanks for opening the thread.

      I see that you have opened this thread in the NinjaTrader 8 Strategy forum, but are inquiring about a NinjaTrader 7 Indicator. I will request to have the thread move so it can be easily found.

      I would advise to look at the log tab of the Control Center to look for any reported run time errors. You will see that there is an error encountered for adding a data series for "EURUSD" that mentions the instrument does not exist in the instrument manager. If you open up a chart for EURUSD, you will use "$EURUSD" and this is the syntax expected by the NinjaScript.

      Plots will exist for each bar of the primary data series. I will also advise to add a CurrentBar check for CurrentBars[0] to avoid indexing issues. Checks using CurrentBars can be found here: https://ninjatrader.com/support/help...urrentbars.htm

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

      Comment


        #4
        thank you

        thank you so much it works perfectly now

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        592 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        554 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X