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 Brevo, Today, 01:45 AM
    0 responses
    3 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    3 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    240 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    384 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    6 views
    0 likes
    Last Post oviejo
    by oviejo
     
    Working...
    X