Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Create a strategy analyzer for new strategy

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

    Create a strategy analyzer for new strategy

    Hi,

    I'm trying to use strategy Analyzer to create a new strategy as below:

    1. mesasure the high and low from 00:00 to 09:00 GMT (or can be changed accordingly). If the range exceed 80 ticks no trades at all for the day.

    2. place long and short orders 10 ticks outside this range, which are automatically triggered if the price reaches those levels. (only trade after 09:00 GMT and close it if neither of these is hit by 18:00 GMT and repeat the process the next day).

    3. if trade triggered, place a profit of 40 ticks and stop loss of 40 ticks.

    I've tried to use highest bar, lowest bar, time series to contruct the conditions but failed.

    Pls help!

    Regards,

    Toyogo

    #2
    Hi Toyogo,

    You would do something like this inside a time filter at 09:00
    Code:
    HighestBar(Close, Bars.BarsSinceSession - 1)
    That will give you the highest bar you are interested in for the current session. (For time filter reference sample go here: http://www.ninjatrader-support.com/v...ead.php?t=3226)

    After you have the number for the highest bar you can plug it into the High[] DataSeries to get the actual high of that bar.
    Code:
    High[HighestBar(Close, Bars.BarsSinceSession - 1)];
    Do the same to get the LowestBar. You will then end up with a comparison like this:
    Code:
    High[HighestBar(High, Bars.BarsSinceSession - 1)] - Low[LowestBar(Low, Bars.BarsSinceSession - 1)];
    Then its just a matter of adding the further logic you want to do with the 80 ticks stuff.

    For the trades take a look at either EnterLongLimit() or EnterLongStop(). See this tip for further information: http://www.ninjatrader-support.com/v...ead.php?t=3271

    Profit and stop loss orders can be placed through these methods: SetStopLoss() and SetProfitTarget()
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by andrewtrades, Today, 04:57 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    4 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    436 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    7 views
    0 likes
    Last Post FAQtrader  
    Started by rocketman7, Today, 09:41 AM
    5 responses
    19 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X