Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

paint bar to next canddle/refresh order to next canddle

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

    paint bar to next canddle/refresh order to next canddle

    Hello, Im working with this indicator,and I wanted some help for 2 cases
    So it paints a canddle in blue when the conditions are met,thats works very well

    1-I want it to continue to paint my bar in blue (if for example 20 ema is rising =true) if my ema is still rising in the next canddle,so it will stop only paint when my ema is not rising anymore ema rising =false

    2-I will use this indicator on a strategy:
    when myindicator=1
    open a order
    but when I have the signal,if the order is not opened in next canddle, it just close the stop order,but I want it to refresh the stop order to the next canddle
    I will add the 20ema rising=true condition and what I need to do next to refresh order to next canddle??


    thanks for any help



    protected override void OnBarUpdate()
    {
    if(CurrentBar<2) return;

    if(Close[0]>Open[0] ...etc.....(my conditions)
    ema20 rising=true
    {
    BarBrush = BarColor;
    InsideBarFound[0] = 1;
    }
    else
    InsideBarFound[0] = 0;

    }

    #region Properties
    Last edited by janio973; 05-17-2022, 06:18 AM.

    #2
    Hi janio973 thanks for writing in. Use the last order overload that lets you keep the order alive:

    EnterLongStopMarket(int barsInProgressIndex, bool isLiveUntilCancelled, int quantity, double stopPrice, string signalName)

    By default, the other order overloads will be canceled at the close of every bar unless they are resubmitted.

    Kind regards,
    -ChrisL

    Comment

    Latest Posts

    Collapse

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