Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Guys need Help

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

    Guys need Help

    protectedoverridevoid OnBarUpdate()
    {

    Bar0
    if (Position.MarketPosition == MarketPosition.Long)
    {
    if (Close[0] < Position.AvgPrice + 50 * TickSize)
    {
    SetStopLoss(CalculationMode.Ticks, Position.AvgPrice);
    EnterShort();
    }
    }
    BAr1
    if (Position.MarketPosition == MarketPosition.Short)
    {
    if (Close[0] > Position.AvgPrice + 50 * TickSize)
    {
    SetStopLoss(CalculationMode.Ticks, Position.AvgPrice);
    EnterLong();
    }
    }
    //conditions
    if (CrossAbove(EMA(Close,Fast), EMA(Close,Slow), 1)
    && RSI(
    Period, Period)[0] > 50)
    {
    EnterShort(DefaultQuantity,
    "");
    }
    if (CrossBelow(EMA(Close,Fast), EMA(Close,Slow), 1)
    && RSI(
    Period, Smooth)[0] < 50)
    {
    EnterLong(DefaultQuantity,
    "");
    }
    }
    end conditions
    Anyone could help me to add multy time on this
    if BAR 0 Starts functioning STOP SELLS in condtions only
    if Bar 1 Starts functioning STOP BUYS in conditions only
    When I do both at a same time keeps trading
    Thanks
    Last edited by XXtrem; 11-18-2010, 06:16 PM.

    #2
    I'm sorry but not fully follow what you're looking to modify, if you want to add another series / timeframe please review this guide - http://www.ninjatrader-support.com/H...struments.html

    Should you wish to get this professionally custom coded for you, a certified NinjaScript consultant would be able to assist - http://www.ninjatrader.com/webnew/pa...injaScript.htm
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    11 responses
    38 views
    0 likes
    Last Post cmtjoancolmenero  
    Started by FrazMann, Today, 11:21 AM
    0 responses
    3 views
    0 likes
    Last Post FrazMann  
    Started by geddyisodin, Yesterday, 05:20 AM
    8 responses
    52 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by DayTradingDEMON, Today, 09:28 AM
    4 responses
    24 views
    0 likes
    Last Post DayTradingDEMON  
    Started by George21, Today, 10:07 AM
    1 response
    21 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Working...
    X