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 DannyP96, 05-18-2026, 02:38 PM
    1 response
    27 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    117 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    69 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    226 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    417 views
    0 likes
    Last Post CaptainJack  
    Working...
    X