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

Indicator Based Stop-loss Strategy

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

  • NinjaTrader_PaulH
    replied
    Hello jak479,

    Thanks for your reply.

    Not that I am aware of, the link in your post# 16 are the best examples.

    Leave a comment:


  • jak479
    replied
    Thanks. That was easy enough. There are some other examples I would like to look at but can't seem to get the strategy builder to recognize. Are there any similar examples I could study as an alternative to them?

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello jak479,

    Thanks for your reply.

    I would suggest removing the extracted files.

    The proper way to import a zipped file is to use Tools>Import>Ninjascript add-on.. and in the selection window only zip files will show.

    Leave a comment:


  • jak479
    replied
    Thanks. With some trial and error I was able to more or less get it working. It broke the trade into several smaller legs but I'm okay with that. I'm wondering about some of the logic I'm using. So I checked the forum for some examples to study but I can't seem to load them up. I've extracted the zip files to the location where my other strategies are but they aren't being recognized inside the strategy builder. Not sure what I am doing wrong.

    Located at



    Attached Files

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello jak479,

    Thanks for your reply.

    You could compare the current bar value of the lower band to the previous bar value of the lower band and see if it is less indicating perhaps a reversal. This may be too reactive as only two bars are considered.

    You could use the Misc>Slope and use the std error bands (pick one of the 3 plots) as the input series. A negative value of slope would indicate falling. The slope allow you o specify how many bars to use for the slope calculation. So you can use Misc>Slope> indicators>std error (pick a plot), less, Misc>numeric value> 0

    Leave a comment:


  • jak479
    replied
    The screenshot reflects historical data. The strategy calculates on each tick. Sorry for the confusion. I meant to state the gold regression line not the 4:01 exit bar. So ideally I would like to make it so an exit order gets submitted when the channel turns south which is at approximately 3:40.

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello jak479,

    Thanks for your reply.

    Is the screenshot of a live trade or a trade made on historical data?

    What is the Calculate setting of the strategy? (Calculate.OnBarClose, Calculate.OnPriceChange, or Calculate.OnEachTick)

    "What I would like to do is have an exit order placed when the gold St. Err bar starts to reverse its direction." In your screenshot I don't see a gold bar. Are you referring to the 4:00 bar or the longer 4:01 bar?

    Can you provide a screenshot of your exit condition?

    Leave a comment:


  • jak479
    replied
    In this trade, there are about 10 ticks of value that got left on the table. I am having trouble configuring the exit to correct this. What I would like to do is have an exit order placed when the gold St. Err bar starts to reverse its direction. I can't quite figure out how to place it in condition builder. Appreciate your help.
    Attached Files

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello jak479,

    Thanks for your reply.

    Yes, using draw markers can be very helpful when debugging. It is common to use them to indicator when a "set" is true. By using different colors (or different objects) and placing them at different y location offsets you can see bar by bar what set it true and when.

    Glad you found the video helpful!

    Leave a comment:


  • jak479
    replied
    Very helpful video. Resulting dots are very helpful in figuring out what is going on. Thanks!


    Click image for larger version

Name:	NQ 03-21 (1 Minute) 2020_12_18 (12_04_27 AM).png
Views:	622
Size:	40.1 KB
ID:	1133173

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello jak479,

    Thanks for your reply.

    Yes, however, to see a marker at every instance you would have to provide a unique tag name for the object. If the same tag name is used the previously drawn object is automatically removed to make way for the new object. This is the default behavior in the Strategy Builder( using the same tag names), so you would only see the latest occurrence.

    The other requirement is the Y location, (Price location), to display the object. Typically you would want to relate this to a price on the chart such as above or below the bar so that it is visible. By default, this value would be 0 so you may be drawing them but at a price of 0 unless you have put in a price reference

    I've attached a short video on how to be able to see all of the markers and well as how to adjust them to place on the chart: https://paul-ninjatrader.tinytake.co...MF8xMTMwNTc0MA

    Leave a comment:


  • jak479
    replied
    Will the drawing show up on backtesting? I only see entries and exits, no indicators on the chart.

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello jak479,

    Thanks for your reply.

    In another set you can check the market position and if long (or short) you can draw a marker, such as a dot/square/triangle at the Yvalue of Position.AveragePrice plus (or minus) the ATR value.



    Leave a comment:


  • jak479
    replied
    I suspect I need to debug my stoploss order entry. What I would like to do is mark up the chart to show where the system has placed its stop orders. Is there a way to do this?

    Leave a comment:


  • jak479
    replied
    Got it working! Thanks for the help!

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by judysamnt7, 03-13-2023, 09:11 AM
4 responses
55 views
0 likes
Last Post DynamicTest  
Started by ScottWalsh, Today, 06:52 PM
4 responses
35 views
0 likes
Last Post ScottWalsh  
Started by olisav57, Today, 07:39 PM
0 responses
7 views
0 likes
Last Post olisav57  
Started by trilliantrader, Today, 03:01 PM
2 responses
19 views
0 likes
Last Post helpwanted  
Started by cre8able, Today, 07:24 PM
0 responses
7 views
0 likes
Last Post cre8able  
Working...
X