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.

    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.

                Comment


                  #9
                  no it works perfectly. thank you very much

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  84 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  47 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  29 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  32 views
                  0 likes
                  Last Post TheRealMorford  
                  Started by Mindset, 02-28-2026, 06:16 AM
                  0 responses
                  66 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Working...
                  X