how to enter/exit a position @certain price

Discussion in 'Strategy Building' started by trdX, Dec 26, 2020.

  1. trdX

    trdX

    hello all,

    I am a newbie in strategy development and I am trying to set up an algo in NinjaTrader that among others will try to keep a long position after a certain price level. This is about futures. So, I would like to set a limit and then make sure I always have a long position above that limit but never below. Which means that every time the price drops (assuming a Long position has already placed and filed) the position needs to close. I have tried to do this in StrategyBuilder module just by setting entry and exit conditions but it executes too many trades and also isn't very successful in live trading.

    I wonder whether there are any indicators that could allow me to filter the orders so I don't have to place that many. A high frequency moving average indicator might help but haven't really tested apart from modifying the bar sizes.

    Have you ever tried to do something like that and have you used any indicators that could filter out such small price movements?

    thanks,
    trdX
     
  2. Robert Morse

    Robert Morse Sponsor

    I have no idea how to code that is NT, but it sounds like you need a conditional order that includes a buy stop that when triggered sends a sell stop. GTC. E.g. CL futures are around 48.30. I only want to be long if you touch 49. Set a buy stop at 49 that also triggers a sell stop at 48.75 after filled. If they are too close, you might end up washing too many trades. Does that follow your plan?
     
  3. trdX

    trdX

    hi Robert,
    Yes, that's the plan and that's also the problem. I am trying to find a way to filter this out so I won't end up washing too many trades.
    trdX
     
  4. Robert Morse

    Robert Morse Sponsor

    You will have to determine your risk/reward ratio on that trade and set your stop at an appropriate place. It will not be the cost basis unless you wait for the future to rise first, then use the cost basis later. You will still have a large number of trades you exit before giving it a chance to be right. You have to have enough confidence in the trade to allow for losses but at the same time protect yourself. No one here can set those levels for you.