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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    59 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X