Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Strategy with uni-renko

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

    Strategy with uni-renko

    Hi, is possible to set the stop loss not in pip but for example when there are 2 bar of opposite value? (i know i could just sum the value of reversal bars, but there is too much noise that get me out too early, even if the bar are not "completed" ; and so i should set a too big stop loss)

    #2
    Hello lorenzoP,

    This would likely not be a set price so you would need to use logic to set the price of the order.

    You could have a condition trigger a market order to exit the position.

    To check that a bar is a down bar, check that the Close is less than the Open. Use 1 as the BarsAgo index to check this for the previous bar.

    For example to check that the previous bar was a down bar you could write:
    if (Close[1] < Open[1])

    You could also set a stop market or stop limit order far below the bar, and then when the condition is true, change the price of the stop order to be the current bid price for a sell exit or the current ask price for a buy exit (depending on the direction of your position).

    Below is a link to an example script that changes the price of a working stop order.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      but, could i do it with strategy builder?

      Comment


        #4
        Hello lorenzoP,

        With the Strategy Builder you can create a condition that compares the close to the open of the previous bar and you are able to submit a market order.

        Also using the Strategy Builder it is possible to use an Exit order like ExitLongStopLimit() and change the price of this order after it is working.

        I've ported an example I created for NinjaTrader 7 to NinjaTrader 8 to demonstrate this with the Strategy Builder.

        The NT7 version can be found in the thread linked below.
        http://ninjatrader.com/support/forum...458#post381458
        Attached Files
        Last edited by NinjaTrader_ChelseaB; 05-16-2017, 08:10 AM.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ghoul, Today, 06:02 PM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        44 views
        0 likes
        Last Post jeronymite  
        Started by Barry Milan, Yesterday, 10:35 PM
        7 responses
        20 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by AttiM, 02-14-2024, 05:20 PM
        10 responses
        180 views
        0 likes
        Last Post jeronymite  
        Started by DanielSanMartin, Yesterday, 02:37 PM
        2 responses
        13 views
        0 likes
        Last Post DanielSanMartin  
        Working...
        X