Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem of Syntax

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

    Problem of Syntax

    Hello all,
    excuse the language errors, but English is not my own language. This is my first post. I want to congratulate the administrators and moderators of the forum and greeting all participants.
    I have a small problem; you can help my?
    Inside the construction of a strategy which is the “syntax” for import into the same code the Bid value of two currencies (for example: Bid value of EURGBP and GBPUSD Bid value)?
    Thank you suffered for your answer.
    Germano

    #2
    Hi germano, thanks for the kind words and welcome to the NinjaTrader support forums!

    You can use GetCurrentBid(int barSeriesIndex) for this and specify from which bars series it should be taken - http://www.ninjatrader-support.com/H...urrentBid.html

    Your second instrument would be added with the Add() method - http://www.ninjatrader-support.com/H...deV6/Add1.html

    Here's a good link to get an overview - http://www.ninjatrader-support.com/H...struments.html

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi germano, thanks for the kind words and welcome to the NinjaTrader support forums!

      You can use GetCurrentBid(int barSeriesIndex) for this and specify from which bars series it should be taken - http://www.ninjatrader-support.com/H...urrentBid.html

      Your second instrument would be added with the Add() method - http://www.ninjatrader-support.com/H...deV6/Add1.html

      Here's a good link to get an overview - http://www.ninjatrader-support.com/H...struments.html
      Thanks Bertrand,
      Sorry, still one comment:
      GetCurrentBid() uses the Bid price while Add() accepts only PeriodType and not the prices (bid ask, etc.). How do I make a comparison between one GetCurrentBid() and an other Add(…currency Bid) ?
      Thank you for your answer.
      Germano

      Comment


        #4
        With Add() you load your second instrument, which will get the barSeriesIndex 1 (0 is the primary one).

        In GetCurrentBid you can then reference this instrument -
        Code:
        [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] myBid = GetCurrentBid([/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]);
        [/SIZE][/SIZE]

        Comment


          #5
          Hi Bertrand,

          Sorry to disturb you, bat I have followed your directions and I built this strategy. I receive the confirmation “Strategy successfully generated” but the strategy not run. You can tell me where is the error?

          Thanks for the Help

          germano
          Attached Files

          Comment


            #6
            germano,

            Please look at your Control Center logs for errors and let us know what shows up there.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Josh View Post
              germano,

              Please look at your Control Center logs for errors and let us know what shows up there.
              Thanks Josh,

              in the Control Center logs there is written:

              02.04.2009 17:23:49,Strategy,Starting NinjaScript strategy 'MyStrategy/833b41d5f35b4826921507324740db14' : On starting a real-time strategy - StrategySync=SubmitLive EntryHandling=AllEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositio ns ExitOnClose=True/ triggering 30 before close Set order quantity by=Strategy,

              Comment


                #8
                No errors? I would have suspected the strategy name to be in conflict with something. Please try renaming it to something other than "Strategy". See if that helps.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Josh View Post
                  No errors? I would have suspected the strategy name to be in conflict with something. Please try renaming it to something other than "Strategy". See if that helps.
                  Fact: I have it call "Ring_EurUsdGbp". Does not work!

                  This is the Control Center logs:

                  02.04.2009 17:49:10,Strategy,Starting NinjaScript strategy 'Ring_EurUsdGbp/754f94a540d345dba661e25302f688cc' : On starting a real-time strategy - StrategySync=SubmitLive EntryHandling=AllEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositio ns ExitOnClose=True/ triggering 30 before close Set order quantity by=Strategy,

                  Comment


                    #10
                    germano,

                    Please post complete logs as well as describe exactly what "does not work" means. What part doesn't work? What are you expecting? What are you seeing instead?
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Excuse Josh,

                      but for me is very difficult to speak in English; they are of Italian language and understand and write in English I use a web translator. Give time please.

                      Comment


                        #12
                        So, with NinjaTrader I was trying to costriure this system: http://kreslik.com/forums/viewtopic.php?t=307

                        Comment


                          #13
                          germano,

                          Unfortunately we cannot evaluate the strategy link you posted. In general, GetCurrentBid() is a real-time property only. When running on a historical chart it will just take the Close price of the bar. This may or may not impact your expectations.

                          Kreslik's work looks fairly complex and it may be something you would like to do with a 3rd party NinjaScript Consultant. Here is a list of them: http://www.ninjatrader.com/webnew/pa...injaScript.htm
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            Thanks Josh,
                            The system exists in MQL language to Metatrader4, but the platform is not sufficiently stable; some times send 3 orders but other times it sends only 2 order. I wanted to try with Ninja Trader because it is a platform that I love.
                            Sorry for the disturb.
                            Thank you Josh and congratulations to the forum.

                            Comment

                            Latest Posts

                            Collapse

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