Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Wizard using variables

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

    Strategy Wizard using variables

    I've been searching around but have not been able to understand yet how to use variables in the Strategy Wizard. I don't know coding so I'm hoping I can do the following in the Wizard using 15 min bars with ES:
    1) When on a 15 min close the Hull moving average changes to positive slope set Variable0 to the value of the high of that 15 min bar
    2) IF there then follows a Close of a 15 min bar that is greater than Variable0 then set that value as Variable1
    3) Enter a buy limit order at the value of Variable1.
    4) If it is 3:45 pm EST or after cancel the order.
    Am I right in thinking that variables are the way to do this? Is it possible using the Wizard? If so could you please point me to the best location to lear how to do this? Thanks!

    #2
    Hello bkout,

    Thank you for your post.

    I have created a video detailing how to set this up in the Strategy Wizard. You may view this video at the following link: http://screencast.com/t/LKM3kUIlie1

    Please let me know if you have any questions.

    Comment


      #3
      Wow that's great Patrick! Saved me a lot of time trying to figure that out. I am however finding one problem as I am testing this out. The rule is that after the slope goes positive ("set-up" bar market with a red diamond on the chart) and there is a close above the high ("confirming bar" marked by a yellow diamond) then a limit order should go in at the close price of the confirming bar. The problem is that the limit price keeps changing to the last closing price where the close was greater than the set-up bar. In the example the limit should have been 89.25 and stayed at that value until the order was allowed to trigger after 8 AM (I use a 24 hour chart and the background areas define tthe time zones). How can I keep the limit order from changing after it is first set? Thanks! http://screencast.com/t/9wd1AXqoVTgC

      Comment


        #4
        Hello bkout,

        The price is being reset every bar because the condition says to set Variable0 on every bar where the Slope is greater than PosS. Changing this to CrossAbove instead of greater than as the comparison operator will cause the strategy to only update Variable0 when the Slope starts below PosS and becomes greater.


        Please let me know if this does not help to resolve your inquiry.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks Chelsea but I think it's perhaps a bit more complicated. Variable0 is the high of the bar when the slope becomes positive and the Limit price might be set on the next bar if the Close is above Variable0 in whcih case the code sets Variable1 at the Close price of that bar and issues a limit order at that price. However there may not be a close price above variable1 for several or many bars or it may not happen at all that day. During that whole stretch of time if the HMA slope remains positive I want the strategy to set the Limit order price to the value of the first close above Variable0 and then for that limit order number to remain the same until it is filled or the signal times out or reverses. Thanks.
          Follow up -- I think I have it. Don't know if there's a simpler way but I set variable1 to a value of zero on the same page where the Limit order is issued and then required that Variable1 be zero in order for a candle to change the Variable 1 value -- that way it can only happen once per signal.
          Last edited by bkout; 05-13-2013, 04:55 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by nleitman, Yesterday, 11:46 AM
          9 responses
          26 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by cmtjoancolmenero, 04-25-2024, 03:58 PM
          18 responses
          105 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by kujista, Yesterday, 12:39 AM
          4 responses
          17 views
          0 likes
          Last Post kujista
          by kujista
           
          Started by Mindset, Yesterday, 06:19 AM
          2 responses
          15 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by bubblegum, 03-18-2024, 10:41 AM
          4 responses
          51 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X