Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy and different Point Values in Forex

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

    Strategy and different Point Values in Forex

    I am using my strategy on forex pairs and now this came up:

    The Point Value for most pairs is 100.000 only the JPY pair has a Point Value of 1000
    Other instruments like the Fdax use contract size.

    Can I add a condition to change the Point Value automatically when my strategy is used on markets with different values?

    #2
    daxtrading, you could unfortunately not change the point value used on the fly - you could though setup a different master instrument fresh and then use this to run your strategy on.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Forex has 4 decimal places but this code:

      Instrument.MasterInstrument.Round2TickSize shows the price markers with 2 decimal places.
      How do I get 4?

      Comment


        #4
        Can you please post a chart the indicator / code applied and the behavior you see? How's the instrument used then setup in the Instrument Manager?

        Thanks,
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          Can you please post a chart the indicator / code applied and the behavior you see? How's the instrument used then setup in the Instrument Manager?

          Thanks,
          I use a strategy plot like this:
          Add(StrategyPlot(8));
          StrategyPlot(8).PanelUI = 1;
          StrategyPlot(8).Plots[0].Pen = new Pen (Color.DarkGreen,2);
          StrategyPlot(8).Plots[0].PlotStyle = PlotStyle.Square;
          StrategyPlot(8).Name = "BuyPrice |DarkGreen|";
          StrategyPlot(8).AutoScale = true;

          and

          Instrument.MasterInstrument.Round2TickSize(BuyPric e);

          if (.........)StrategyPlot(8).Value.Set(BuyPrice);

          Comment


            #6
            On which instrument do you run here? You can edit the plotted the indicator to override the default price markers used - http://www.ninjatrader.com/support/h...ricemarker.htm

            This should help you out here.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              On which instrument do you run here? You can edit the plotted the indicator to override the default price markers used - http://www.ninjatrader.com/support/h...ricemarker.htm

              This should help you out here.
              It's not an indicator but a strategy and I use it on forex pairs.
              Where do I put the code from your url?

              Comment


                #8
                Daxtrading, the default behavior is for plots to be displayed with only two decimal places. Bertrand's suggestion is for you to override this behavior so it shows the price markers with all four decimal places.

                You should place the code on the same level as OnBarUpdate(), like this:
                Code:
                OnBarUpdate()
                {
                 // your on bar update stuff here
                }
                
                public override string FormatPriceMarker(double price)
                {
                    // Formats price values to 4 decimal places
                    return price.ToString("N4");
                }
                AustinNinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Austin View Post
                  Daxtrading, the default behavior is for plots to be displayed with only two decimal places. Bertrand's suggestion is for you to override this behavior so it shows the price markers with all four decimal places.

                  You should place the code on the same level as OnBarUpdate(), like this:
                  Code:
                  OnBarUpdate()
                  {
                   // your on bar update stuff here
                  }
                  
                  public override string FormatPriceMarker(double price)
                  {
                      // Formats price values to 4 decimal places
                      return price.ToString("N4");
                  }
                  I added the following just below the OnBarUpdate part, so not in it.
                  // FormatPriceMarker method of a custom indicator
                  public override string FormatPriceMarker(double BuyPrice)
                  {

                  // Formats price values to 4 decimal places
                  return BuyPrice.ToString("N4");
                  }

                  and removed Instrument.MasterInstrument.Round2TickSize(BuyPric e);

                  This is the error I get:

                  FormatPriceMarker(double) did not find methode to overwrite

                  Comment


                    #10
                    daxtrading, I overlooked this earlier, but the FormatPriceMarker only works for indicators. It doesn't work in strategies.

                    Is your strategy calculating the precision to two decimals with Round2TickSize, or is it only plotting with the two decimals?

                    Please try sending the Round2TickSize output to Print() to see if it is calculating correctly.
                    AustinNinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_Austin View Post
                      daxtrading, I overlooked this earlier, but the FormatPriceMarker only works for indicators. It doesn't work in strategies.

                      Is your strategy calculating the precision to two decimals with Round2TickSize, or is it only plotting with the two decimals?

                      Please try sending the Round2TickSize output to Print() to see if it is calculating correctly.
                      Hi Austin,

                      When I print the Round2TickSize it prints four decimals.
                      It's the plotting with only two decimals.

                      Comment


                        #12
                        Daxtrading, please put the FormatPriceMarker stuff in the StrategyPlot indicator and see if that works.
                        AustinNinjaTrader Customer Service

                        Comment


                          #13
                          Daxtrading says: "Thank you NinjaTrader"

                          With great help from the NinjaTrader Team, I finally finished my strategy on Forex Pairs.

                          I learned so much from guys like Bertrand, Brett, Vincent, Austin and others.
                          Also this forum was very helpful.

                          Many thanks!!!

                          Maarten

                          Comment


                            #14
                            Maarten, thank you for the kind words. We do our best to help our users, and I'm glad to hear you finished your strategy. Best of luck to you and your trading ventures!
                            AustinNinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by quantismo, 04-17-2024, 05:13 PM
                            3 responses
                            25 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Started by ScottWalsh, 04-16-2024, 04:29 PM
                            7 responses
                            34 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Started by cls71, Today, 04:45 AM
                            0 responses
                            5 views
                            0 likes
                            Last Post cls71
                            by cls71
                             
                            Started by mjairg, 07-20-2023, 11:57 PM
                            3 responses
                            214 views
                            1 like
                            Last Post PaulMohn  
                            Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                            4 responses
                            547 views
                            0 likes
                            Last Post PaulMohn  
                            Working...
                            X