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 andrewtrades, Today, 04:57 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    3 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    436 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    7 views
    0 likes
    Last Post FAQtrader  
    Started by rocketman7, Today, 09:41 AM
    5 responses
    19 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X