Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    11 responses
    39 views
    0 likes
    Last Post cmtjoancolmenero  
    Started by FrazMann, Today, 11:21 AM
    0 responses
    5 views
    0 likes
    Last Post FrazMann  
    Started by geddyisodin, Yesterday, 05:20 AM
    8 responses
    52 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by DayTradingDEMON, Today, 09:28 AM
    4 responses
    26 views
    0 likes
    Last Post DayTradingDEMON  
    Started by George21, Today, 10:07 AM
    1 response
    22 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Working...
    X