• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Working with user Variables

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

    Working with user Variables

    Is there a way to work with formulas from within Strategy Builder to set my User-variables value? Specifically, I want to reset the value after a target was touched, to Zero. That was easy using the Variable = 0 in an Condition / 'action' window. However, If I had a trade which was a loss, I want to add the loss to the variable for that exit and subsequent exits until a profit target was reached, so as to keep a running tab of cumulative loss. I want to use the loss value for subsequent purposes. Is this possible in Strat. Builder or am I off to the wilderness of script editing?

    #2
    Hello RedRock,

    Thanks for writing in to our Support Forums!

    There is currently not any functionality to set a variable to another variable (or the same variable) with a mathematical offset. I may submit a feature request for this feature on your behalf, if you'd like.

    Otherwise, you would have to unlock the code and do the scripting manually.

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

    Comment


      #3
      Thank-You.

      As manipulating variables is beyond the scope of Strategy Builder, could you possibly point me to some examples where a variable is changed upon some event occurring?

      For example I want to keep track of the number of losing trades before a win is achieved, at which point the variable is reset to zero. Sort of a consecutive real-time loss counter.

      Comment


        #4
        Hello RedRock,

        Thanks for the reply.

        It is within the goal of the Strategy Builder to allow you to build strategies without a programming background. It would benefit yourself as well as others to have the added functionality to do this from the GUI.

        We do not build custom indicators or strategies for customers but if you’d like I could have someone from our business development team pass over a list of professoinal Ninja Script consultants that you could contact about developing this for you. If this is the case please write in to platformsupport[at]ninjatrader[dot]com with the text "1678176 ATTN Jim" in the subject of the email.

        The NinjaTrader 7 help guide contains basic programming concepts that teach you about variables and other basic programming syntax.

        You can view the programming resources from NinjaTrader 7's help guide here:
        Basic Syntax - https://ninjatrader.com/support/help...sic_syntax.htm
        Programming Concepts - https://ninjatrader.com/support/help...g_concepts.htm
        NinjaScript Editor 401 - https://www.youtube.com/watch?v=BA0W4ECyVdc

        After you have looked into working with variables, and are comfortable with your knowledge of C# you may wish to look at the reference sample on protective orders so you can write your strategy to keep track of your trades in OnOrderUpdate() and OnExectution(). These overrides are for advanced programmers so I advise to start small with your programming endeavors.

        That sample can be found here:
        http://ninjatrader.com/support/forum...ead.php?t=7499

        I'm still willing to submit the feature request for the Strategy Builder to have better variable handling. Please let me know if you would like me to submit a request for it.
        JimNinjaTrader Customer Service

        Comment


          #5
          Sure Jim, Please submit the request... Great idea which should be helpful to many!

          I have been programming in another more 'natural language' environment for some time. So I know that Ill need to get a grasp on C# to make full use of NT8. Ill look at your samples and see if I can get my brain to 'click'.

          Thanks, RR

          Comment


            #6
            Hello RedRock,

            Thanks for your input to help improve NinjaTrader.

            The feature request is being tracked with ticket ID SFT-2059 and can be seen in the Release Notes of the version of NinjaTrader 8 that contains the feature request's implementation. You can use the link below to view the Release Notes page of the help guide.

            http://ninjatrader.com/support/helpG...ease_notes.htm

            You may also writing in to platformsupport[at]ninjatrader[dot]com to ask a technician on the status of the ticket ID.

            Please let me know if you have any questions.
            JimNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bchip, Today, 09:25 AM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Tomass, Today, 09:25 AM
            2 responses
            12 views
            0 likes
            Last Post Tomass
            by Tomass
             
            Started by hundert, Today, 08:37 AM
            3 responses
            18 views
            0 likes
            Last Post NinjaTrader_Melissa  
            Started by ronaldgreene828, Today, 08:16 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_PatrickG  
            Started by hir04068, Today, 01:36 AM
            1 response
            18 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Working...
            X