Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Strategy Development Issues

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

    Custom Strategy Development Issues

    Here is what I am trying to do.

    When the Futures FX market opens at 5pm Sunday:
    Look at the first two bars
    a. if the open of bar 2 is higher than the open of bar 1 enter a long pos.
    b. if the open of bar 2 is lower than the open of bar 1 enter a short pos.
    c. set variable0 to value of bar 2's open price.

    (so far so good, all the above seem to work)

    d. when the default input series crosses above variable0, close short position and open long position
    e. when the default input series crosses below variable0, close long position and open short position

    (these, d & e don't work)

    f. when profit target of 100 ticks occurs, close all positions
    g. do not reenter positions

    (f works)

    Any thoughts on why I can't get the reversal to work?
    Attached Files

    #2
    Hi, for sets 4 and 5 you want to use then 'EnterShort' and 'EnterLong' to close any open positions and reverse. The way had it setup, it would only close the open position to go flat.

    Comment


      #3
      one issue corrected, another remains

      Your fix worked. Thank you Bertrand! I had been working on this strategy on two computers and sent the file from the wrong one which used an exit and an entry simultaneously (irrelevant now though.)

      Now the problem seems to be an issue with artifacts on the daily close as attached.



      Ideally I would like this to work as a 23 hour trade 5pm to 4pm the next day, but ninja always seems to stop out at midnight. Not sure why it closes and reopens twice near midnight when entries are only crossings.
      Any thoughts on why this is happening consistently?

      Comment


        #4
        You would need to debug your orders. Please use TraceOrders = true. http://www.ninjatrader-support2.com/...ead.php?t=3627
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X