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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    56 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    75 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    39 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    101 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    60 views
    0 likes
    Last Post PaulMohn  
    Working...
    X