Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simple Strat to Help Me Understand

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

    Simple Strat to Help Me Understand

    Howdy--

    I'm looking to create a simple strategy to better understand how to build strategies, as to date I have only built indicators. I was curious if someone could help me walk through how to create a dead simple strategy that I can then use to modify with other indicators.

    So let's say that we want to create a strategy that uses four (4) 14 period Bollinger Bands ("BB"): an upper at 2, an upper inside at 1, a lower inside at -1 and a lower at -2, which we in turn could call BB2, BB1, BB-1 and BB-2, respectively.

    1. Enters Long when price touches the BB-1 with a profit target ("PT") at BB2 and a stop at BB-2.
    2. Enters Short when price touches the BB1 with a PT at BB-1 and a stop at BB2.
    3. I do not want my PT and stop to be valid until the next bar (i.e., the entry bar is just an entry bar...nothing else).
    4. I want to enter and exit with market orders.

    So pretty a slow pitch BB strategy that I can then use to modify as necessary.

    Here is my first crack at the Strategy wizard:

    1. Name it
    2. Create "Period" input of type int with a Default value of 14 (i.e., because we're using a BB with a period of 14)
    3. Conditions and Actions:

    -Set 1:
    --When the following actions are true: "Close >= Bollinger(1, 14, Upper)" (BB1 is short entry)
    --Do the following: EnterShort

    -Set 2:
    --When the following actions are true: "Close <= Bollinger(1, 14, Lower)" (BB-1 is long entry)
    --Do the following: EnterLong

    -Set 3:
    --When the following actions are true: "Close <= Bollinger(2, 14, Lower)" (BB-2 is long PT)
    --Do the following: ExitShort

    -Set 4:
    --When the following actions are true: "Close >= Bollinger(2, 14, Upper)" (BB2 is long PT)
    --Do the following: ExitLong

    -Set 5:
    --When the following actions are true: "Close >= Bollinger(2, 14, Upper)" (BB2 is long stop)
    --Do the following: ExitShort

    -Set 6:
    --When the following actions are true: "Close <= Bollinger(2, 14, Lower)" (BB-2 is short stop)
    --Do the following: ExitLong

    Here are my questions:

    1. How do I make sure that a stop or PT is not triggered on the entry bar?
    2. How do I use Strategy Analyzer to run a backtest on this?

    Thanks!

    Aventeren

    #2
    Hello,

    While I wont be able to create the strategy for you I will be able to further assist with your questions.

    If you do not want a stop or profit target to trigger with the entry you will have to not set a stop/target on the stops/targets page of the wizard. If you did this you would then have to insert other logic into your script (different condition set) the Exit long as you have written.

    If you wanted the strategy to attach a stop/target at a later point in time that did not cancel at the close of a bar you would need to do this with custom coding.

    This video is a great place to start for strategy development as well as the basics of the strategy analyzer: http://www.youtube.com/watch?v=SpwGTr9kl9k

    Specifically this section has some more videos and documentation on the strategy analyzer : http://www.ninjatrader.com/support/h...a_strategy.htm

    Let us know how we can further assist.
    LanceNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by proptrade13, Today, 11:06 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by quantismo, 04-17-2024, 05:13 PM
    4 responses
    31 views
    0 likes
    Last Post quantismo  
    Started by love2code2trade, 04-17-2024, 01:45 PM
    4 responses
    32 views
    0 likes
    Last Post love2code2trade  
    Started by cls71, Today, 04:45 AM
    2 responses
    10 views
    0 likes
    Last Post eDanny
    by eDanny
     
    Started by kulwinder73, Today, 10:31 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Erick  
    Working...
    X