• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.

    https://drive.google.com/file/d/1UUu...w?usp=drivesdk

    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 webus, Today, 02:03 AM
                  1 response
                  11 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by Polufson, 07-30-2020, 06:34 PM
                  9 responses
                  56 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by bosajin, Yesterday, 05:37 PM
                  1 response
                  10 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by brunoviveiros, 08-04-2020, 09:36 AM
                  3 responses
                  36 views
                  0 likes
                  Last Post ATMtrader0001  
                  Started by DieSlower, Yesterday, 09:46 PM
                  1 response
                  17 views
                  0 likes
                  Last Post NinjaTrader_PaulH  
                  Working...
                  X