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

EMA Paint bar

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

    EMA Paint bar

    Hi,

    I have found this indicator:

    Smaoverunderpaintbar NT8 | NinjaTrader Ecosystem

    In the code how do I remove the MA line from being displayed? I just want the bars changing colour and nothing else.

    It's ok I figured it out =]

    Cheers thanks
    Last edited by t00sp00ky; 06-20-2021, 09:01 AM.

    #2
    Hello t00sp00ky,

    On line 74, ttt is assigned a value from SMA(Close, sMA)[0];. This can be changed to the EMA.
    On line 75, uuu is also assigned a value from SMA(Close, sMA)[0], which can also be changed to the EMA.

    Below I am providing a link to a forum post with helpful information about getting started with NinjaScript and C#.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Yep I got it thanks.

      Just a quick question that may sound ridiculous but is alluding me on this platform which is new to me. How do I set an alert to trigger when price is crossing above/below a MA? But only when the bar has closed crossing in the correct direction. Not when it has touched, not when it beyond, only when it has closed crossing the MA.

      Also once in a trade, the lollies that display your sell LMT and STP etc, can they be modified so they are longer, so they are not in the way? I would prefer them to be in the centre of my chart not offset to the right as they are atm

      Thanks
      Last edited by t00sp00ky; 06-24-2021, 02:23 AM.

      Comment


        #4
        Hello t00sp00ky,

        CrossAbove() / CrossBelow() can detect a cross with Calculate.OnBarClose.

        If the script is running with Calculate.OnEachTick or .OnPriceChange, you would need to make a direct comparison when FirstTickOfBar is true.
        Code:
        if (FirstTickOfBar && Close[2] < EMA(14)[2] && Close[1] > EMA(14)[1])
        ChartTrader cannot display orders a different way. But you can turn off ChartTrader and use drawing objects to mark orders / trades from OnOrderUpdate().

        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi,

          Can this not be set up in the alerts menu so I can apply it to any MA not just this paint bar indicator? There seems to be lots of options in the menu apart from on bar close, I seem to have tested them all with no joy so far

          Comment


            #6
            Hello t00sp00ky,

            This is posted in the Indicator Development section of the forums. Are you asking about the Chart Alerts window (Platform Technical Support section of the forums) and not developing a custom indicator?


            The CrossAbove/CrossBelow can be setup in the Alerts window conditions. This would be real-time and would not be just when the bar closes.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by sdauteuil, 09-23-2021, 10:16 AM
            10 responses
            1,263 views
            0 likes
            Last Post NinjaTrader_RyanS  
            Started by Grantx, 05-31-2020, 06:49 AM
            7 responses
            1,384 views
            0 likes
            Last Post marcus2300  
            Started by ETFVoyageur, 05-18-2024, 12:45 AM
            3 responses
            20 views
            0 likes
            Last Post ETFVoyageur  
            Started by sylviannyc, Today, 09:07 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Started by warpinator, 05-16-2024, 10:44 AM
            4 responses
            36 views
            0 likes
            Last Post warpinator  
            Working...
            X