Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entries and exits

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

    Entries and exits

    My entries based on a plot of an indicator doesn't seem to fire when they are supposed to and my stoploss doesn't work at all. The target works fine though. Any ideas?

    protectedoverridevoid Initialize()
    {
    Add(GartleyRobotBull(
    5, 2, 65));
    SetStopLoss(
    "30", CalculationMode.Ticks, 0, false);
    SetProfitTarget(
    "", CalculationMode.Ticks, 20);
    // CalculateOnBarClose = true;
    }
    ///<summary>
    /// Called on each bar update event (incoming tick)
    ///</summary>
    protectedoverridevoid OnBarUpdate()
    {
    // Condition set 1
    if ((Low[1] > GartleyRobotBull(5, 2, 65).Plot4[0])
    && (Low[
    0] < GartleyRobotBull(5, 2, 65).Plot4[0]))
    {
    EnterLong();
    }
    }

    The strategy entry is based on an indicator (which is also plotted on the chart). The entry should occur after the price drops below Plot4 which is the blue dot between the green dot and the blue dot.

    As this is my first attemp at a Ninjascript strategy I am sure there is a lot wrong. See attached jpeg for further info.
    Attached Files

    #2
    Entries and exits

    The SetStopLoss("30".. was set for zero (CalculationMode.Ticks, 0)
    SetStopLoss("30", CalculationMode.Ticks, 25, false);
    or
    SetStopLoss(CalculationMode.Ticks, 25);.

    SetStopLoss(CalculationMode mode,double value)

    I hope this helps.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    558 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X