Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterShortLimit works great. How to offset "longs" ?!

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

    EnterShortLimit works great. How to offset "longs" ?!

    Here is one simle strategy:

    SetStopLoss("", CalculationMode.Ticks, 6, false);
    SetProfitTarget("", CalculationMode.Ticks, 3);

    CalculateOnBarClose = false;
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    // Condition set 1
    if (RSI(14, 3).Avg[0] < RSI30)
    {
    EnterLongLimit(DefaultQuantity, Low[1] + 2 * TickSize, "");
    }

    // Condition set 2
    if (RSI(14, 3).Avg[0] > RSI70)
    {
    EnterShortLimit(DefaultQuantity, High[1] + 2 * TickSize, "");




    EnterShortLimit(DefaultQuantity, High[1] + 2 * TickSize, "");

    THat command to go "short" works just fine. It takes previous "close" of the bar, adds +2 ticks and tryes to go short from that point.

    Example: PreviousBar = 1059.00.
    Make OpenShort order on 1059,50.
    Great.

    But, shat should i do to make same trick with open long position?
    EnterLongLimit(DefaultQuantity, Low[1] + 2 * TickSize, "");

    Because that line also works, but it does the wrong thing really.

    Example: PreviousBar = 1059.00.
    Make OpenLong order on 1059,50.

    So, basicly it makes a OpenLong order higher, then the previous bar closed, and ofc i need it to do the: Yeah.. go LONG, but not by +2 ticks higher order!

    How to force it to make an LOngOrder which will look like that: Low[1] - 2 * TickSize

    So, if last BAr was closed in like 1059,00.
    How to set up an long order 2 ticks lower when that... at 1058,50 ?


    Again, i`ve searched that forum, but didnt find anything here.
    I`ve tryed to put "-" sign inside that command instead of "+"... but
    seems so that command High[1] - 2 * TickSize, ""); doesnt works...

    Any clues?

    #2
    ahhhh... that problem was tottaly solved. SO, Admins, you may really delete that thread.

    Cheerz!

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    77 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    45 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    27 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    63 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X