Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
      JimNinjaTrader Customer Service

      Comment


        #4
        thank you

        thank you so much it works perfectly now

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by TradeForge, 04-19-2024, 02:09 AM
        2 responses
        28 views
        0 likes
        Last Post TradeForge  
        Started by aprilfool, 12-03-2022, 03:01 PM
        3 responses
        327 views
        0 likes
        Last Post NinjaTrader_Adrian  
        Started by giulyko00, Today, 12:03 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by f.saeidi, Today, 12:14 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by AnnBarnes, Today, 12:17 PM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Working...
        X