Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issues with granularity

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

    Issues with granularity

    Hi,

    Once again, I'm having trouble comprehending granularity and Ninja's trade logic. Here's what I'm trying to do:

    1) If today's daily close is greater than yesterday's daily high a signal is generated.
    2) Submit a market order if intraday price trades above the signal bar's daily high.
    3) If filled maintain position until the market closes (daily) lower than the previous daily bars low.
    4) If condition #3 is violated submit market order.

    Here the logic I've written which obviously doesn't work:

    if(Close[0]>High[1] && BarsInProgress==0)
    {
    tradeSignal=true;
    }

    if(tradeSignal==true && BarsInProgress==1)
    {
    if(Closes[1][0]>Highs[0][0]) // trying to compare intraday price to previous day's high
    EnterLong();
    }

    if(Close[0]<Low[1] && BarsInProgress==0 && Position.MarketPosition==MarketPosition.Long)
    {
    ExitLong();
    }

    #2
    d.allen101,

    Austin will respond to you on your other thread posting this question. Thank you for your patience.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ender_wiggum, Today, 07:56 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by kevinenergy, 02-17-2023, 12:42 PM
    124 responses
    2,986 views
    1 like
    Last Post Panama9878  
    Started by TanyaD, Yesterday, 10:07 AM
    3 responses
    15 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by cmv727, 08-28-2018, 09:27 AM
    6 responses
    1,080 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Taddypole, Yesterday, 12:56 PM
    9 responses
    27 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X