Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Request Breakeven Functions in Strategy Builder

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

  • NinjaTrader_ChrisL
    replied
    Hi Gruss, the forums are English only. Please translate your text through a translator before posting.

    The samples come as is. Any modifications must be done by the community.

    Best regards.

    Leave a comment:


  • Chidiroglou
    replied
    Hallo Chelsea
    ich habe denHast Du die Möglichkeit ein Script dieser Strategie davon zu erstellen auch für Sell Positionen ?
    Ich habe leider nicht die Erfahrung dafür, währe Dir sehr dankbar.

    Gruss Vasili
    Attached Files

    Leave a comment:


  • Steve4616
    replied
    It would be fantastic if the script Chelsey supplied went in both directions. I have spent 8 days now trying to get this to work on long and short. Paul also created a script that worked both ways for Trailing stop but I can seem to ,make a simple change to Breakeven instead of Trailstop (I know it seems like an easy fix but I can't get it). I've tried everything and emailed and had a bunch of responses yet still no luck.

    Leave a comment:


  • HaveGunsWillTravel
    replied
    [QUOTE=NinjaTrader_ChelseaB;n810922]Hello 123r34,

    I have received a tracking ID for your request.

    Your request for the Strategy Builder to have breakeven settings is being tracked with ID #SFT-2212.


    Add me to this request also would you please?

    Leave a comment:


  • ezrollin
    replied
    Would like to add my vote thanks

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hi Lester, thanks for posting.

    Does the example work on your end? I would recommend using this as a template for making your trailing stop. I am not able to tell what the issue with your code is from the information provided. Please use the provided example as a base case, then work in your own entry/exit logic. Using the Print statement in the Actions>Misc menu to print data from your strategy can also be very helpful to see what conditions the strategy is hitting and which conditions are being skipped, and also useful to print variables your script is using.

    Kind regards,
    -ChrisL

    Leave a comment:


  • LesterC01
    replied
    Originally posted by NinjaTrader_ChelseaB View Post
    Hello 123r34,

    I am happy to submit a feature request on your behalf for the NinjaTrader Development to consider this for a future version of NinjaTrader. Please let me know if you would like to do this.

    NinjaScript Strategies are meant to have the behavior customized by the logic of the programmer including any trailing or breakeven movements.

    Attached are two examples of a breakeven movement and a trailing action created with the Strategy Builder.

    (Update August 5th, 2020 - changed the CurrentTriggerPrice and CurrentStopPrice variables to doubles)
    I have built a strategy in which I am trying to use a trailing stop and have created the Trailing Stop just like the example posted by Chelsea in the TrailBuilderExample file she attached. However, I am sometimes not having it move up in price or stop out at the right place. In the attached example I have the TrailFrequency Input set to 10 ticks and the TrailStopDistance set to -10 ticks. As it shows in the example, it went against me more than 18 ticks and still hadn't stopped out. What would be causing this?
    Attached Files

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hi litamm, thanks for posting.

    This should work on any bar type in the platform. Do you see any errors in the Log tab of the Control Center? Did you add any Prints to the strategy to see if the logic is being executed when expected? Please also test using the Playback connection or Simulated data feed to help test the strategy.

    Kind regards.

    Leave a comment:


  • litamm89
    replied
    Originally posted by NinjaTrader_ChelseaB View Post
    Hello 123r34,

    I am happy to submit a feature request on your behalf for the NinjaTrader Development to consider this for a future version of NinjaTrader. Please let me know if you would like to do this.

    NinjaScript Strategies are meant to have the behavior customized by the logic of the programmer including any trailing or breakeven movements.

    Attached are two examples of a breakeven movement and a trailing action created with the Strategy Builder.

    (Update August 5th, 2020 - changed the CurrentTriggerPrice and CurrentStopPrice variables to doubles)

    NinjaTrader_ChelseaB

    Does this work for renko bars?

    I downloaded the template and it didnt execute.

    I remember I had it working before but now it doesnt seem to move the stop loss.

    Any ideas?

    Leave a comment:


  • FuturesPhantom
    replied
    In case anyone needs to ever to use BarsSinceExitExecution in a strategy here is sample of it in a actual strategy made to take a lot of entries and made to limit the exact number of bars since each prior exit.

    FuturesPhantom


    HTML Code:
    protected override void OnBarUpdate()
    {
    
    if (BarsInProgress != 0)
    return;
    if (CurrentBars[0] < 20)
    return;
    if ((Position.MarketPosition == MarketPosition.Flat))
    if (Close[0] > Close[1])
    // if (IsRising(EMA1) == true)
    
    if (BarsSinceExitExecution(0, "", 0) == - 1)
    {
    EnterLong(Convert.ToInt32(DefaultQuantity), "");
    }
    else if (BarsSinceExitExecution(0, "", 0) >= 5)
    {
    EnterLong(Convert.ToInt32(DefaultQuantity), "");
    }
    else
    {
    return;
    }
    
    if (Close[0] < Close[1])
    
    {
    ExitLong(Convert.ToInt32(DefaultQuantity), "", "");
    
    }
    
    
    }
    }
    }

    Leave a comment:


  • rafael_delima86
    replied
    Originally posted by FuturesPhantom
    I give up also... I may as well pretend that BarsSinceExitExecution doesnt exist. I don't believe It is not possible to create even the simplest strategy example that shows its making many trades while creating a minimum distance since a last execution.


    Watch this video, it should help....

    I wish Strategy Builder would allow ATM Strategy, it would save a lot of people so much time and energy

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hi Futures,

    You can use it in a condition to, say, reset the boolean variable that I use in the sample script e.g.



    Kind regards,
    -ChrisL

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hi FuturesPhantom, thanks for posting.

    You can print out the value of BarsSinceExitExecution to test the method. I attached a simple test strategy that enters the market once then prints the BarsSinceExit property.

    Kind regards,
    -ChrisL

    Attached Files

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hi rafael, thanks for posting.

    We do not have a video that demonstrates trailing logic. The best resources will be Chealses example on the first page of this thread.

    Kind regards,
    -ChrisL

    Leave a comment:


  • rafael_delima86
    replied
    Hello all,
    I tried to follow the zip file for breakeven trigger but I’m stuck. The file has parameters to enter long on a specific place. I already have my strategy 99% completed, all I need is the trigger but I cannot follow the steps. Does anyone ever make a video explaining how to set that up instead of a zip file???

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
0 responses
636 views
0 likes
Last Post Geovanny Suaza  
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
0 responses
366 views
1 like
Last Post Geovanny Suaza  
Started by Mindset, 02-09-2026, 11:44 AM
0 responses
107 views
0 likes
Last Post Mindset
by Mindset
 
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
0 responses
569 views
1 like
Last Post Geovanny Suaza  
Started by RFrosty, 01-28-2026, 06:49 PM
0 responses
571 views
1 like
Last Post RFrosty
by RFrosty
 
Working...
X