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

Indicator and steategy (dll) together ?

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

    #16
    Originally posted by marynja View Post
    I think no, because if i pass the value of the indicators enum object all work correclty, for example:

    Add(myIndicator(myEnum.One);

    but if i pass the strategy enum object the error is launched :

    Add(myIndicator(aSelectableValue);

    And i dont understand because aSelectableValue is a enum object too...
    Is aSelectableValue defined as being of myEnum?

    Comment


      #17
      Hello koganam, i upload the .cs of the indicator (NEWSMA) and the strategy (myStrategy).

      Please, look myStrategy.cs:

      If i Add the indicator enum value all work

      If i Add the strategy enum dont work... why?

      Thank you a lot !
      Attached Files

      Comment


        #18
        Creatin strategy with two indicators

        hello, Can anyone help me to create an strategy combining 2 indicators... autodivergence macd indicator(d3spotterv3 when detects a divergence sends alert and command to autofibo to draw fibo between hi and low of the divergence, the set up an buy/sell order on 23,8%+2pips with tp on 38,2% fibo-2pips. and stop loss0% fib-5pip. condition : if price breaks 0% without reaching 23,8 fib then order canceled and wait for next divergence

        please does anyone know if this is possible ???

        best

        Comment


          #19
          Originally posted by marynja View Post
          Hello koganam, i upload the .cs of the indicator (NEWSMA) and the strategy (myStrategy).

          Please, look myStrategy.cs:

          If i Add the indicator enum value all work

          If i Add the strategy enum dont work... why?

          Thank you a lot !
          The fact that you have defined myEnum and esEnum to have the exact same members does not make them equivalent types: they have absolutely no relationship to each other.

          When you add the indicator to anything, you must pass it with the correct parameters. As you are polluting the global namespace with your myEnum definition, myEnum is available to all classes. Just define your parameter in the Strategy to be of type myEnum.
          Last edited by koganam; 11-20-2014, 11:39 AM. Reason: Corrected spelling.

          Comment


            #20
            Originally posted by PEPBOSCH View Post
            hello, Can anyone help me to create an strategy combining 2 indicators... autodivergence macd indicator(d3spotterv3 when detects a divergence sends alert and command to autofibo to draw fibo between hi and low of the divergence, the set up an buy/sell order on 23,8%+2pips with tp on 38,2% fibo-2pips. and stop loss0% fib-5pip. condition : if price breaks 0% without reaching 23,8 fib then order canceled and wait for next divergence

            please does anyone know if this is possible ???

            best
            It is possible to code it, yes. But what you have described is rather elaborate. You may have to hire someone to code it: I kind of doubt that you are going to get that done for free.

            Comment


              #21
              Originally posted by koganam View Post
              myEnum is available to all classes. Just define you parameter in the Strategy to be of type myEnum.
              Thank you koganam ! i am trying but i can find solution. Please, could you send me a code example of the stratey?

              Thanks !!

              Comment


                #22
                Originally posted by marynja View Post
                Thank you koganam ! i am trying but i can find solution. Please, could you send me a code example of the stratey?

                Thanks !!
                Code:
                            private esEnum aSelectableValue    = esEnum.Ten;
                should be
                Code:
                             private myEnum aSelectableValue    = myEnum.Ten;
                after which, you have to expose the property correctly.
                Code:
                            [Description("Select Period")]
                            [GridCategory("Select Period")]
                            public esEnum mySelect{
                                get { return aSelectableValue ; }
                                set { aSelectableValue  = value; }
                            }
                should be
                Code:
                             [Description("Select Period")]
                            [GridCategory("Select Period")]
                            public myEnum mySelect{
                                get { return aSelectableValue ; }
                                set { aSelectableValue  = value; }
                            }

                Comment


                  #23
                  The error was solved thnak you. the key was this declaration

                  private myEnum aSelectableValue = myEnum.Ten;

                  Thank you very much koganam and NT Support.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Waxavi, Today, 02:10 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post Waxavi
                  by Waxavi
                   
                  Started by TradeForge, Today, 02:09 AM
                  0 responses
                  8 views
                  0 likes
                  Last Post TradeForge  
                  Started by Waxavi, Today, 02:00 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post Waxavi
                  by Waxavi
                   
                  Started by elirion, Today, 01:36 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post elirion
                  by elirion
                   
                  Started by gentlebenthebear, Today, 01:30 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post gentlebenthebear  
                  Working...
                  X