• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy backtest Bollinger band

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

  • NinjaTrader_AlanP
    replied
    Hello kyamato,

    In the support department at NinjaTrader we do not create, debug, or modify code for our clients. This is so that we can maintain a high level of service for all of our clients.

    You would swap out the if statement CrossBelow and instead write your if statement for the touch of the lower BB. When this touch happens you would set the bool to true.

    You can also contact a professional NinjaScript Consultants who would be eager to create or modify this script at your request or assist you with your script. Please let me know if you would like our business development follow up with you with a list of professional NinjaScript Consultants who would be happy to create this script or any others at your request.

    Please let us know if you need further assistance.

    Leave a comment:


  • kyamato
    replied
    Hi,

    Thanks for that. However where in this code does it make a requirment that the price must touch the lower band of BB first?

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello kyamato,

    I put together some screen shots which demonstrate how to create a variable, AboveVar, which is initially set to false.

    When the price crosses below a 14 period SMA, the bool mentioned above is set to true. Set 1.

    Then in a new set of conditions and actions “Set 2”, you’ll see the if statement checking if AboveVar is true as well as if price is above the CurrentDay Open.

    You could use this as a framework for what you’re looking to do.

    A step by step instructions for how to build your specific logic would be out of the scope of our support, but you should be able to use the information here to write what you’re looking to do. If you’d like, I can have someone reach out with a list of third parties that would be interested in building this for you.

    Please let us know if you need further assistance.
    Attached Files

    Leave a comment:


  • kyamato
    replied
    Hi Alan,

    How can I set this up with Nt8 strategy builder without having to write my own code? A basis step by step would be very helpful.

    thanks

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello kyamato,

    Thank you for your note.

    To write what you’re looking to do, you would want to set a bool when the price touched the lower Bollinger band.

    An example of setting a bool would be,

    Code:
    private bool isTrue=false;
    
    if(Close[0]>Close[1])
    isTrue=true;
    Then in a different set of conditions, you would check if that bool was true, as well as your other criteria.

    For example,

    Code:
    if(isTrue==true && Close[0] >CurrentDayOHL().CurrentOpen[0])
    The following links are to the helpguide covering the methods you mentioned,

    https://ninjatrader.com/support/help...nger_bands.htm
    https://ninjatrader.com/support/help...nt_day_ohl.htm

    Please let us know if you need further assistance.
    Last edited by NinjaTrader_DrewO; 01-15-2020, 10:10 AM.

    Leave a comment:


  • kyamato
    started a topic Strategy backtest Bollinger band

    Strategy backtest Bollinger band

    Hi,

    How can I setup the rules in NT8 with the following logic.

    If Price touches the bottom bollinger band, then anytime after it crosses the midline and when the price crosses the midline it must be higher than the open of session.

    Could you make a small video showing me how to do this?

    Thanks

Latest Posts

Collapse

Topics Statistics Last Post
Started by D Trader, Yesterday, 09:43 AM
1 response
8 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by cassiano_sanches, 07-10-2020, 07:37 PM
1 response
14 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by terminatorT1000, 07-10-2020, 06:40 PM
2 responses
31 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by Giudiver, 07-10-2020, 04:29 PM
2 responses
17 views
0 likes
Last Post Giudiver  
Started by rtwave, Today, 04:11 PM
0 responses
4 views
0 likes
Last Post rtwave
by rtwave
 
Working...
X