Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

2 questions

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

    2 questions

    Hi,
    1. I want to trade 2C, profit 10 ticks and 2nd C is open.
    I only want this to happen at the beginning of the set up.
    What I am getting right now is, every signal: going short 2C and taking the profit for both off at 10 ticks.
    So, how do I set it up:
    2 C at beginning of entry
    1 C target 10 ticks
    1 C open at my exit signal, which I know how to do.

    2. I still haven't been able to figure out how to create a RSI cross over with a diverengence: having a 2nd higher RSI cross over.
    This is what I have:
    Set 1
    RSI crosses> SMA RSI
    Variable 0 = Varialble 1

    Set 2
    Variable 0= Varialbe 1
    RSI crosses > SMA RSI

    But this only gives me a signal on every RSI crossing up.

    How do I configure it so I get a signal on a higher RSI crossing up?

    Thanks
    Rachel

    #2
    Rachel, for the first part - are you referring to setting up an ATM strategy in the SuperDOM? Or is this for an automated strategy?

    Coding divergences mechanically in can be a challenge, in your sample you would also need to record the RSI value and check that is higher / lower at point 2. You also need to reset your user defined variable, so it can detect the condition again.

    You can check this script for ideas how to spot divergence - http://www.ninjatrader-support2.com/...&id=65&catid=1
    BertrandNinjaTrader Customer Service

    Comment


      #3
      response

      Hi,
      1st part of question is the autotrade.
      This is what I am experiencing:
      I have a strategy long and short, 1 C just doing waiting for it to reverse.
      I am watching it in the Dom and even though my Control Center says I do not have any working orders, my Dom is saying I am long 2 contracts.

      I have the strategy set for 1C.

      Earlier today, I was trying to do:
      2 C
      1 with a 10 tick profit
      the other one I wanted it to be open.
      But it was just selling 2 and both were getting out at 10 ticks.
      I also had a couple of other strategies on the same contract working.

      Now, for some reason, even though I set it for only 1 contract each direction, it initiates 2 Contracts.

      I am just running one strategy and don't feel comfortable with the confusion on this matter.

      So, how can I set up 2 C
      1 with a 10 tick target
      the other
      1 open

      and how can I make sure, on the ones, that I only want 1 C, that I only have 1 C?

      It is bazar.

      Thanks,

      Rachel

      PS Thanks for the Diverengence spotter. But if you can show me how to create it for the Wizard that would be more helpful. I can't put an alert on the chart with the Diverengence spotter.

      Comment


        #4
        Rachel, I think the issues you report are due to your account position not being in sync with your strategy position, please review this link carefully - http://www.ninjatrader-support.com/H...tPosition.html

        To create strategies that scale out, you will first need to scale in with two entry orders, each one contract. Then you can exit one with a profit target and close the other open one with a custom exit order.

        I will check if the divergence detection can be done in the wizard...
        BertrandNinjaTrader Customer Service

        Comment


          #5
          follow up

          Thank you for the info.
          So, let's say, the session ends.
          Will my strategy still be out of sync until I add the extra contract? or will it balance itself so the next day, it will be in sync again?

          One more question: is there a way to program the wizard for in a rising market, only take the long set ups?
          Let's say:
          I have a long and short entry in a rising market: just take the long set up and exit at the short set up but do not inititate a short in a rising market.

          Thanks,

          Rachel

          Comment


            #6
            This will depend on how you start up the strategy every day, please check the settings under your strategies tab (Tools > Options > Strategies > NinjaScript > On starting a realtime strategy). The first option waits until your strategy is flat and takes the next entry order live then, which prevents synching issues. The second one submits the historical working orders when you start your strategy, so you would need to make manually sure you strategy and account position are in sync when you want to use this option.



            Sure you can check for a rising market in the wizard, although this will depend on how you define this - you could for example check for the slope of a longer term moving average and trade in this direction then.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              How do I serialize an enum type parameter of an indicator?

              For example in the D3spotter it has an enum type of indicator that they are going to use in confirming a divergence or convergence. Examples are the RSI, SMA, EMA, etc.,

              Now, I will have to used it in the strategy. I would like to call it and I want that I can also change directly the indicator that are going to be use in the setup page of the strategy without going to the code.

              For example in the code, I set the Indicator method as an Indicator.SMA now in the setup page of the strategy I want to change it to Indicator.EMA before I enable the strategy.

              D3SpotterS(true, Color [DarkMagenta], 3, Drawing2D.DashStyle.Solid, 25, 3, 12, 0.3, "long.wav", 1, IndicatorMethod.RSI, "Alert1.wav", "Alert2.wav", 1, 14, 7, 14, true).Avg[0].

              Notice the IndicatorMethod.RSI parameter? I want that to be a variable wherein I could change it to IndicatorMethod.SMA without going back to the code. Someone could help me on that one? Indicator.RSI is an enum on the D3SpotterS indicator.

              Comment


                #8
                Edward, you would then create an enum in your strategy to be able to select settings easily of your called indicator - like for example done in the MACrossBuilder offered in the sharing section:

                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bortz, 11-06-2023, 08:04 AM
                47 responses
                1,606 views
                0 likes
                Last Post aligator  
                Started by jaybedreamin, Today, 05:56 PM
                0 responses
                8 views
                0 likes
                Last Post jaybedreamin  
                Started by DJ888, 04-16-2024, 06:09 PM
                6 responses
                18 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by Jon17, Today, 04:33 PM
                0 responses
                4 views
                0 likes
                Last Post Jon17
                by Jon17
                 
                Started by Javierw.ok, Today, 04:12 PM
                0 responses
                13 views
                0 likes
                Last Post Javierw.ok  
                Working...
                X