Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

coding

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

    coding

    hello
    I am trying to code a simple thing and any help is appreciated. I am trying to subtract EMA 8 from 13...

    I want to code:

    s2 = EMA 8 - EMA 13

    Buy when s2 cross above 0
    sell when s2 cross below 0

    i know it is simple but i cant figure it out neither in strategy builder not in coding. any help in appreciated.

    thanks in advance.

    #2
    Hello babouin77,

    Thanks for your question.

    I have created a video demonstration to explain how this would be done.



    Please let me know if you have any additional questions.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thank you so so much... really very helpful and I learned a lot from ur video. thanks again

      Comment


        #4
        one more question, If I want to use it on a range chart how can I do that? I have the chart on range 20 I do not see historical trades... if I change the chart to 5 min for example, I see the trades... any idea?
        Attached Files

        Comment


          #5
          I am trying to convert this from TOS to NT8...


          def s2 = MovAvgExponential(close, 8) - MovAvgExponential(close, 13);

          plot line = s2;
          plot ZeroLine = 0;

          line.AssignValueColor(if s2 <= 0 then Color.RED else Color.GREEN);

          AssignPriceColor(if s2 <= 0 then Color.RED else Color.GREEN);

          Alert(s2 crosses above ZeroLine, "Cross above 0", Alert.BAR, Sound.Ring);
          Alert(s2 crosses below ZeroLine, "Cross below 0", Alert.BAR, Sound.Bell);


          AddOrder(OrderType.BUY_AUTO, s2 crosses above ZeroLine, tickcolor = GetColor(1), arrowcolor = GetColor(1), name = "LE");
          AddOrder(OrderType.SELL_AUTO, s2 crosses below ZeroLine, tickcolor = GetColor(2), arrowcolor = GetColor(2), name = "SE");

          but it only works on range charts good and not on the minute chart.. any trick I need to do to make it show on range in NT8 the solution you gave me?

          Comment


            #6
            not worried about the color change at the moment...fyi

            Comment


              #7
              no worries. it was my bad. thanks a lot for your help have a good day

              Comment


                #8
                Hello babouin77,

                Please be sure to open new questions as new threads. (This helps to keep threads organized and easier for readers to find resolutions or answers to questions.)

                Could you clarify if there is anything withstanding from your original inquiry that would need to be addressed?

                If there is something that needs attention from your second inquiry, please open a new thread and include a link to this thread so our forum moderators can delete the unrelated posts.

                I look forward to assisting.
                JimNinjaTrader Customer Service

                Comment


                  #9
                  no it works perfectly. thank you very much

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Lumbeezl, 01-11-2022, 06:50 PM
                  31 responses
                  817 views
                  1 like
                  Last Post NinjaTrader_Adrian  
                  Started by xiinteractive, 04-09-2024, 08:08 AM
                  5 responses
                  14 views
                  0 likes
                  Last Post NinjaTrader_Erick  
                  Started by swestendorf, Today, 11:14 AM
                  2 responses
                  6 views
                  0 likes
                  Last Post NinjaTrader_Kimberly  
                  Started by Mupulen, Today, 11:26 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post Mupulen
                  by Mupulen
                   
                  Started by Sparkyboy, Today, 10:57 AM
                  1 response
                  6 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Working...
                  X