Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with strategy

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

    Help with strategy

    I have a very simple strategy, what I think is simple at least but the platform isnt doing what I think it should be doing.

    My strategy is simple. take a bar, if the current price is lower than the low of the previous bar I want to sell. If the current price is higher than the high of the last bar I want to buy.

    I do this through the Wizard as "Ask < Low[1]" and "enter short" also "close longs"
    Also "Bid > High [1]" and "enter Long"

    I think I may have figured out whats wrong, it is looking at the open of the current bar to see if its higher or lower than the last bar, it is not taking current prices into account.

    I attached a picture of the chart, as you see there is a long entry at 1332.00, should have exited 3 bars later and gone short. it did not it waited for the next bar that opened below the prior bars low to sell and go short. Not what it should do. I did un-click the option for calculate on bar close. What am I missing?

    Thanks
    Attached Files

    #2
    illcrx, a few things to keep in mind here for this setup -

    1. CalculateOnBarClose would only be effective in realtime trading / simulation or Market Replay, in backtesting it would always be 'true'.

    2. Bid / Ask would be replaced via Close prices on historical data

    3. To access the last completed bar, just use an index of 0

    To visualize it easier when your programmed conditions exactly trigger, try adding a drawing statement to them.

    BertrandNinjaTrader Customer Service

    Comment


      #3
      1) The screenshot was real time simulated trading, I understand that back testing cant get real time tick data.
      2) Ok, that makes sense
      3) I thought 0 was current and 1 was 1 bar ago. so is my strategy trying to reference 1 bar ago from 2 bars ago? Is that what you are saying?
      4) So your saying for me to literally draw something on the chart? Doesnt it already do that? I can see where its entering its just not doing it where I want it.

      How would you do this strategy? is ask>high[1] not correct?

      Comment


        #4
        illcrx, strategy could get for example ignored due to the internal order handling rules, in such cases the seen executions could lead you off track debugging a script, therefore we prefer to add visuals to be clear when exactly the underlying condition should fire a signal. For the back referencing, it would depend which CalculateBarClose setting you would use on running the strategy. With this set to 'false', you would reference the last completed bar's high in your condition and not the currently developing bar.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by traderqz, Today, 12:06 AM
        2 responses
        3 views
        0 likes
        Last Post traderqz  
        Started by RideMe, 04-07-2024, 04:54 PM
        5 responses
        28 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by f.saeidi, Today, 08:13 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by DavidHP, Today, 07:56 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by kujista, Today, 06:23 AM
        3 responses
        11 views
        0 likes
        Last Post kujista
        by kujista
         
        Working...
        X