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.

    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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        32 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, Yesterday, 02:41 AM
        0 responses
        14 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        23 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        34 views
        0 likes
        Last Post CarlTrading  
        Working...
        X