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 DJ888, 04-16-2024, 06:09 PM
        4 responses
        12 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by terofs, Today, 04:18 PM
        0 responses
        11 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by nandhumca, Today, 03:41 PM
        0 responses
        7 views
        0 likes
        Last Post nandhumca  
        Started by The_Sec, Today, 03:37 PM
        0 responses
        3 views
        0 likes
        Last Post The_Sec
        by The_Sec
         
        Started by GwFutures1988, Today, 02:48 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Working...
        X