Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pop up window

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

    Pop up window

    Hi,

    I am looking for example of code or simillar strategy:
    Strategy take signal from indicator, pop=up window appears asking if I want enter. Choise y/N (with options i number of lots,). Entering Yes would trigger the entry.

    appreciate your help
    Thanks
    peter

    #2
    Peter, welcome to our forums - unfortunately I'm not aware of such an example already shared here. Per default NinjaScript strategies would work without manual interaction / confirmation.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand,

      Thank you for replay. Ny next question is: Is it possible to program pop-up window in NT?
      I am new to programong.

      thanks
      peter

      Comment


        #4
        You're welcome - this is possible within C# programming and since then doable in NinjaTrader as well, but unfortunately we do not provide support in this area (only on what we document in our NT help-guide and reference samples here on forum).
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thanks for your replay,

          I am trying to create strategy which can read when indicator is printing dot. If indicator print green dot the strategy would take long trade. If indicator print red the strategy take short.

          Can you dirrect me to simillar script?

          thanks
          peter

          Comment


            #6
            Peter, the easiest thing would be if you simply recreating the coloring conditions in the strategy directly and then take action as needed. If this is not possible, then add a boolSeries to your indicator and just set the signal value (1 for example for a long [green dot], -1 for a short [red dot])...next step would be then exposing this series so the strategy could read it for triggering signals - http://www.ninjatrader.com/support/f...ead.php?t=4991
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Thank you so much for your help.
              Under your guidance I am learning a lot.
              I have another question. If I want the logic to be executed only on bar closed which function can I use?
              I think this example (OnbarUpdate() is checking every tick) is executing trades any moment cross happened. I want only at bar close.

              protectedoverridevoid OnBarUpdate()
              {
              if (CrossAbove(SMA(Fast), SMA(Slow), 1))
              EnterLong();
              elseif (CrossBelow(SMA(Fast), SMA(Slow), 1))
              EnterShort();
              }

              Can you direct me to example which check only when bar close.

              thanks
              peter

              Comment


                #8
                Peter, you're welcome - this will depend on the strategies CalculateOnBarClose setting you use -

                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Bertrand View Post
                  Peter, the easiest thing would be if you simply recreating the coloring conditions in the strategy directly and then take action as needed. If this is not possible, then add a boolSeries to your indicator and just set the signal value (1 for example for a long [green dot], -1 for a short [red dot])...next step would be then exposing this series so the strategy could read it for triggering signals - http://www.ninjatrader.com/support/f...ead.php?t=4991


                  Hi ,
                  This information was very helpfull . At this moment I am trying to figure out how can I use indicator which has options for changing period of moving average like . In example which you included there is MACD(12, 26, 9) and SampleBoolSeries can be moved from indicator to SampleBoolSeriesStrategy. If we use EMA or any other indicator with options we need to use something else. And I dont know what.

                  Your help is very appreciated
                  thanks
                  peter

                  Comment


                    #10
                    Peter, I'm sorry but I'm not sure I follow what you seek - are you referring to indicator that offer multiple plots and how you would access those in your script? For example the Histogram of the MACD would be

                    double value = MACD(12, 26, 9).Diff[0];
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Hi,

                      I am learning as I go. Sorry for being not clear. Your help is great.

                      1)For now I am trying to solve problem how to use for example EMA instead of MACD(12,26,9). I am not clear how we write in SampleBoxSeriesStrategy to call indicator EMA which have period. It can be EMA(3) ,EMA(4)... When I need in my strategy lets say EMA(3) and EMA(8) what can I do? Ist the same EMA just different period.

                      2)I like the idea of transporting parameter from indicator to strategy using ExposedVariable.
                      (SampleBoolSeries().ExposedVariable);
                      Is there example which shows how to handle ExposedVariable inside Strategy similar way as BullIndication and BearIndication?

                      I found this message and I wanted to ask if you can expand on this with example:

                      ""
                      Larry, the indicator in the example I sent you can do this without a problem.

                      Upon import, the sample adds an indicator and a strategy to your NinjaScript collection. The indicator is called SampleBoolSeries, but it also exposes a double value--exactly what you're trying to do.

                      At line 37 in SampleBoolSeries the double called exposedVariable is declared. Then it is assigned a value later in OnBarUpdate() at line 94. The last important section is in properties, where the exposedVariable becomes retrievable at lines 116-122.

                      Then line 63 in the strategy (SampleBoolSeriesStrategy) retreives the value from the indicator.

                      Please let us know if you have any other questions.
                      __________________
                      Austin, NinjaTrader Customer Service
                      NinjaTrader is a FREE application for advanced charting, market analytics, system development and trade simulation.

                      View schedule of upcoming online product training events.



                      Last edited by NinjaTrader_Austin; 07-13-2009 at 10:55 AM.
                      ""

                      thanks
                      peter

                      Comment


                        #12
                        Peter, you would need to call the EMA with the parameters as you need it - http://www.ninjatrader.com/support/h...onential_e.htm

                        You can store the value in variable and then refer to it of course, too - if you need more flexibility please create a user defined input to set the Period 'on the fly' - http://www.ninjatrader.com/support/f...ead.php?t=5782

                        For the SampleBoolSeries, you can readily download the example code needed from the link I provided - it would contain

                        a) how to expose a variable

                        b) how to expose a dataSeries that is not a plot (as Plots are exposed by their nature, thus their values are easily accessed)
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          Thanks for help.

                          I have another question:
                          Can you direct me to the examples how to handle multiple entries and exits. For now 1 entry with 2 lots.\But exits will have different criteria. As well reentry of another lot. It looks like every lot needs some identification which can be traced.

                          thanks again
                          Peter

                          Comment


                            #14
                            Peter, I would suggest reviewing this sample here - http://www.ninjatrader.com/support/f...ead.php?t=3225
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              Thanks Bertrand,

                              I appreciate your help.
                              At this moment I am facing problem how to express number of pips for the open trade.
                              If[Number of pips of open trade is yyy] do this

                              or IF[ distance of the present price to open price is yyy] then do this

                              Its more about Money Management. How to express present position of the open trades.

                              Thanks again
                              Peter

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by CortexZenUSA, Today, 12:53 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post CortexZenUSA  
                              Started by CortexZenUSA, Today, 12:46 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post CortexZenUSA  
                              Started by usazencortex, Today, 12:43 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post usazencortex  
                              Started by sidlercom80, 10-28-2023, 08:49 AM
                              168 responses
                              2,266 views
                              0 likes
                              Last Post sidlercom80  
                              Started by Barry Milan, Yesterday, 10:35 PM
                              3 responses
                              13 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Working...
                              X