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

Programing MACD,DMA Fibonacci Levels

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

    Programing MACD,DMA Fibonacci Levels

    Hi Guys,

    I hope someone can help me with this little bit, just to give me some pointers.

    I am new to ninja trader. I have uploaded historical data to ninja trader, 1 minute data (last) for WTI and BRENT for last 5 years. I have bid and ask as well, but not sure if I will use them.

    I am writing my MSc Thesis on backtesting of the strategy. I thing it is reasonably easy to do for someone who already has experience with this.

    What I need to do is test data for EMA or SMA on 15 or 30 or 1 Hour chart when the uptrend/downtrend is identified it will go long/short. Profit to risk would be 1:1.5, so 45pips profit with 30 pips stop loss.

    Next thing what I need to do is program MACD Fast 8, slow 17 and smooth 9, with combination with DMA with settings 3x3, 7x5, 25x5. Buy or sell signal would only come when all of the indicators are showing uptrend or downtrend with same 1:1.5 profit to risk as above.

    Than I would like to add Fibonacci retracement levels to MACD and DMA in order to find out if combination with fibo would improve the results.

    Has anybody done this or something similar? I am currently going through some NT videos on youtube, some published by NT some by others and through NT strategy wizard and forums. Could someone please help me how to go about this?

    Once programed this would be tested on out of sample data.

    Thank you in advance for any help.

    #2
    Hello,

    Thank you for the question.

    This would really depend on what portion of work you would like to put into this project.

    If you already create NinjaScript or plan to create the Script yourself, our support can assist with any questions you have regarding syntax use or other logic in NinjaTrader. Otherwise if you did not want to develop this yourself, you could have it developed for you through a third party as well.

    If you need further information in either direction, please let me know and I can provide help where needed.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Can you give me some references for a third party job on my algos? I'm a bit behind in life about my script reading and writing, so I'd like to just have it smithed for me right away.

      Comment


        #4
        MACD and DMA already come with NinjaTrader. There is nothing to code. The strategy can be easily coded, but you would need to specify, how you determine your stops and profit targets.

        Adding Fibonacci retracement levels is more of a challenge, because you would need to create a zigzag indicator - the zigzag that comes with NinjaTrader is not fit for this purpose - and then define how you would use Fibonacci levels to validate or invalidate the trade.
        Last edited by Harry; 10-22-2015, 07:32 AM.

        Comment


          #5
          Hi Jesse,

          Thanks for your reply. I am not currently writing script, but I am trying to learn and experimenting with strategy wizard and code writing. I have found a few educational videos either on NT chanell or YouTube in general . But I struggled so far to find examples of setting (examples) for aforementioned indicators but than I have been working on it for only 2 days so far. So I guess more I read and watch, I will figure it out.

          Comment


            #6
            Hi Harry,
            Thanks for pointers.
            I know MACD is in NT, I am just trying to set it up in strategy wizard, with not much luck so far but I guess it's learning curve.

            Regarding DMA, I tried to find it in Nt strategy wizard between indicators already in there but I do not have DMA in the list. But if I am not mistaking, which I could be, is not DMA just simple moving average but moved forward (to the right) by required amount of bars? I did not get to DMA so far as I am playing with MACD at the moment. If you would know of any links on this and could post them, would be great.

            Regarding Fibonacci , I haven't even scratched that part yet. Could you elaborate little bit more please why the zig zag indicator given by NT is not good for this purpose? Again if you would know of any links on this issue, it would be great.
            Thank you for your input.

            Comment


              #7
              HI,

              I also would like to ask, I have couple of programed strategies from online webinars in NT. When I open a new chart, right click on it column comes up, but it will not let me click on strategy (or clicking CTRL + S) nothing happens as option is not available to select. I have seen people doing this on webinars but on mine it does not work.

              I can get to strategies but only through FILE, NEW, Strategy analyser and the programed strategies are there through back test button.

              Any ideas why this might be?
              Thank you in advance.

              Comment


                #8
                Hello,

                If the Strategies area is gray, it could potentially mean you are not connected. I just wanted to ensure you are connected to any connection while trying to add the strategy, can you confirm that for me?

                If you are connected, this can also happen if you have chart trader open, if that's the case you just need to close Chart Trader.

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by zemlic View Post
                  Hi Harry,
                  Thanks for pointers.
                  I know MACD is in NT, I am just trying to set it up in strategy wizard, with not much luck so far but I guess it's learning curve.

                  Regarding DMA, I tried to find it in Nt strategy wizard between indicators already in there but I do not have DMA in the list. But if I am not mistaking, which I could be, is not DMA just simple moving average but moved forward (to the right) by required amount of bars? I did not get to DMA so far as I am playing with MACD at the moment. If you would know of any links on this and could post them, would be great.

                  Regarding Fibonacci , I haven't even scratched that part yet. Could you elaborate little bit more please why the zig zag indicator given by NT is not good for this purpose? Again if you would know of any links on this issue, it would be great.
                  Thank you for your input.
                  The DMA is indeed a simple displaced moving average. When you add an indicator to a chart, the is an option to select the displacement in the indicator dialogue box, and the SMA will show up as displaced moving average.

                  If you wish to run the DMA through a strategy analyzer, it is better to hardcode the displacement as input parameter for the DMA, such that you can access it for optimizing your strategy.

                  Coding a DMA with a parameter added would take a few minutes.

                  All Fibonacci retracements are calculated from swing highs and lows. You would therefore first find a rule to identify these highs and lows. Basically, there are two rules possible. The first rule would identify the new high or low based on a price move, which is called the minimum deviation. The Zigzag indicator that ships with NinjaTrader follows this rule. Unfortunately it uses ticks or a percentage to measure the minimum deviation. This means that it does not adjust to the instrument, chart type and timeframe. Therefore you would not be able to compare results from different instruments and timeframes.

                  If you wish to compare results and do coherent backtests, you would need to use indicators that comply with William Eckhardt's coherency test (the c-test). For the zigzag this can be achieved by replacing the tick or percentage with the average true range.

                  The second rule that can be used to find swing highs and lows is the bar count. This method is used in the Swing indicator that ships with NinjaTrader. However, I advise against the use of this rule, as it will produce too many irregular sized Fibonacci retracements, because this rule is not based on price change parameters.

                  In short: It is preferable to us a volatility adjusted zigzag - volatility could be ATR or standard deviation - to build the fib retracements.
                  Last edited by Harry; 10-24-2015, 04:26 AM.

                  Comment


                    #10
                    Hi Jesse,
                    Thank you for your reply. Indeed you are right, I am not connected to anything as my kinetick demo account expired and I do not have live account yet. I gues there is nothing else that can be done about that.

                    Comment


                      #11
                      Hi Harry,

                      Thank you very much for your help. I really appreciated . It will save me lots of time searching .

                      Zemlic

                      Comment


                        #12
                        How to start

                        Hi Guys,

                        I am trying to learn programing (strategy and indicators) in NT. I am currently going through the webinars, NT help and any other videos on programing. Could you please advise me, what is the best way to start as it is getting a bit confusing. I do not have any programing backround so I am going from the scratch. I read somewhere that best way is to start with C+ programing as it will make more sense. What is your opinion on this???? If so, could you advice on any good literature to start with. I know there is plenty out there, but would like to go with something recommended.

                        Thank you for any advice

                        Comment


                          #13
                          Originally posted by zemlic View Post
                          Hi Guys,

                          I am trying to learn programing (strategy and indicators) in NT. I am currently going through the webinars, NT help and any other videos on programing. Could you please advise me, what is the best way to start as it is getting a bit confusing. I do not have any programing backround so I am going from the scratch. I read somewhere that best way is to start with C+ programing as it will make more sense. What is your opinion on this???? If so, could you advice on any good literature to start with. I know there is plenty out there, but would like to go with something recommended.

                          Thank you for any advice
                          NinjaTrader uses C#. You should definitely get a good book on Visual C# and not even think about starting with C+. If you wish to learn French, you could first take a course in ancient Latin. This would improve your general knowledge, but it would not help you when speaking French.

                          Just follow a basic course in C#, and this should be enough to deal with NinjaScript afterwards. NinjaScript is just an extension of C#.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by pmachiraju, 11-01-2023, 04:46 AM
                          8 responses
                          149 views
                          0 likes
                          Last Post rehmans
                          by rehmans
                           
                          Started by mattbsea, Today, 05:44 PM
                          0 responses
                          5 views
                          0 likes
                          Last Post mattbsea  
                          Started by RideMe, 04-07-2024, 04:54 PM
                          6 responses
                          33 views
                          0 likes
                          Last Post RideMe
                          by RideMe
                           
                          Started by tkaboris, Today, 05:13 PM
                          0 responses
                          5 views
                          0 likes
                          Last Post tkaboris  
                          Started by GussJ, 03-04-2020, 03:11 PM
                          16 responses
                          3,283 views
                          0 likes
                          Last Post Leafcutter  
                          Working...
                          X