Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Renko Crossing Moving Average

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

    Renko Crossing Moving Average

    I have numerous questions as i have little to no experience with programming. Ive created modified indicators in code but never actually created one. Anyways here come the questions.

    1. I was testing the crossing moving average on Ninja Trader with the renkos and it works pretty well except there are a few problems.
    (I) How do I get rid of the renk gaps that it does when sessions end?
    (II) How can I Re edit the parameters of the ATS without actually having to remove it and reimplement everything?
    (III) How can I backtest it with watching it do live transactions in smaller time schedule and see the results from it? I.E. Testing the strategy from December until now and watching it tick by tick (doesnt have to be tick by tick)

    2. I was also wondering if its capable how can I add the moving average of choice for which ones do the crossovers. Also will it allow me to do it with custom moving averages that arnt in Ninja Trader? (I.E. TMA , ALMA, etc)

    3. is it possible to calculate specific sources ( close, open, etc) ?

    Thank you in advance to any customer service Agent who responds as I am extremely extatic to work and communicate with you. I deeply apologize for any inconvinience in my questions or the way they are represented. These are all the questions I can come up thus far.

    Thank you again

    Sincerely, Christos

    #2
    Can someone help me?

    Can someone help me please?

    Comment


      #3
      Hello Christos,

      Thank you for your inquiry and welcome to the NinjaTrader Support Forum!

      To answer your questions:
      1. I. Unfortunately, there is no way to 100% prevent this. However, you may be able to use the Default 24/7 or ETH session template.

        II. In order to edit the parameters of the strategy, you must disable the strategy first. To do this, you'll want to right-click on the chart and select Strategies. Select the active strategy and, to the parameters on the right of the window, switch Enabled to False. Click Apply. You will then be able to change the parameters. Just be sure to enable the strategy once more after changing the parameters.

        III. Unfortunately, it is not possible to watch trades live through a backtest. However, you would be able to use Market Replay to test your strategy over historical data and watch your trades execute.

        For more information about Market Replay, please take a look at this link to the NinjaTrader help guide: http://ninjatrader.com/support/helpG...ket_replay.htm

        We also have a video on our YouTube that details the Market Replay functionality: https://youtu.be/cgB1y3df7l0

      2. I am not exactly clear about this question. You would be able to use either CrossAbove() or CrossBelow() to check for crossovers.

        For more information about CrossAbove(), please take a look at this link to the NinjaTrader help guide: http://ninjatrader.com/support/helpG...crossabove.htm

        For more information about CrossBelow(), please take a look at this link to the NinjaTrader help guide: http://ninjatrader.com/support/helpG...crossbelow.htm

        You may be able to find TMA, ALMA, etc. indicators here on our support forum.

      3. Close, Open, High, Low, etc. of bars can be easily retrieved through NinjaScript. I would suggest taking a look at our handy Alphabetical Reference guide in our help guide for information: http://ninjatrader.com/support/helpG..._reference.htm

        To access the Close value of the current bar, you could do Close[0], for example.

        We also have a handy Educational Resources section in the help guide that can assist with the development of indicators and strategies: http://ninjatrader.com/support/helpG..._resources.htm


      Please, let me know if I can be of further assistance.
      Zachary G.NinjaTrader Customer Service

      Comment


        #4
        How can i use the default 24/7 or ETH session template?

        Also for the question with 2. What I was asking is instead of just using the simple moving average is there a way I can choose my own moving average? if so, How can I change it?


        Thank you for taking your time to help me.

        Comment


          #5
          Hello Christos,

          To change the session template of your chart, you would right-click on the chart and select Data Series. Once the Data Series window pops up, on the parameters to the right of the window, there will be a section titled Session template under the Data category. This is where you would be able to change your session template.

          You would be able to specify any moving average in a custom coded strategy and use this moving average for your calculations. I would suggest taking a look at the SampleMACrossOver strategy's code that is included with NinjaTrader for some hints on this. To do this, you'll want to click on Tools -> Edit NinjaScript -> Strategy in the NinjaTrader Control Center. Once the Edit Strategy window pops up, double-click on SampleMACrossOver to open a code window to display this strategy's coding.

          Please, let me know if I may be of further assistance.
          Zachary G.NinjaTrader Customer Service

          Comment


            #6
            Hello Zachary thank you so much for giving me the help im studying as much as i can to make a really good program !

            For some odd reason though im trying to access the market replay but gives me the following error

            "Login Failed : Please close all other connections before connecting to 'External data Feed, Market Reply Connection' or Simulated Data Feed'

            Also I am also attempting to have the sources as an option when you are making preferable changes with the strategy through the parameters. Anyway I can do this or would i have to constantly go to the coding and just change it manually ?

            Can you help me on this?
            Last edited by cnikitopoulos94; 08-27-2015, 01:12 PM.

            Comment


              #7
              Hello Christos,

              Please ensure that you are not connected to any other connections before trying to connect to Market Replay. You will be able to see what you are connected to at the bottom left corner of the NinjaTrader Control Center.

              To disconnect from these connections, you'll want to click on File -> Disconnect -> [connection name]

              You could create an enum property to specify if you would like the High, Low, Close, etc. and using a switch statement, assign the value of one of these DataSeries to the variable.

              I've attached an example (EnumExample), created by NinjaTrader_Jesse, to this post on how to utilize an enum. To import this ZIP file into NinjaTrader, you'll want to click on File -> Utilities -> Import NinjaScript.

              Here's a simple example switch statement:
              Code:
              enum SourceSelection { High, Low };
              private SourceSelection sourceSelection;
              private double theSelection = 0;
              switch (sourceSelection)
              {
                   case SourceSelection.High:
                        theSelection = High[0];
                        break;
                   case SourceSelection.Low:
                        theSelection = Low[0];
                        break;
              }
              Please take a look at this link for more information about utilizing an enum and switch: http://www.dotnetperls.com/switch-enum

              Please, let us know if we may be of further assistance.
              Attached Files
              Zachary G.NinjaTrader Customer Service

              Comment


                #8
                Correct me if I am wrong, I dont want it to do it if based on the data. I just want to have people have the choice of changing the source based on choice.

                I.E. if someone wants to edit the strategies moving average 'number of periods'. All they have to do is right click strategies, and then they can see it on the right hand side.

                I was just wondering if thats possible to do as well with the action of choosing a source. Default being close

                So in code ( It might look some thing like this?)


                if (CrossAbove(SMA(Source, Fast), SMA(Source, Slow), 1))
                {
                EnterLong(DefaultQuantity, "");
                }

                Then when you go to ninja traders chart and want to edit the parameters of the strategy there can be a box where it says source. Then you can choose HL/2, OHLC/4, Open, Close.

                I am also attempting to do that with the moving averages. So it can give me the choice of which moving average to choose from on the parameters as well.

                Also for some Odd reason the moving average doesnt calculate live Renko data on mine. I.E. If the renko bars just formed a new bar the moving average waits until it closes in order to go to it.. Anyway i can change that? I attatched a picture for better understanding

                Also for some odd reason with the demo account its not stating how much equity i have, It says im holding positions as well but doesnt say how much im winning or losing.

                Sorry Zach. I know these are alot of questions, I tried digging to find an answer but couldnt find one.
                Attached Files
                Last edited by cnikitopoulos94; 08-27-2015, 11:21 PM.

                Comment


                  #9
                  Hello Christos,

                  My previous post has provided an example on how to create a parameter than can be used to change the source. An enum would allow you to switch between various choices.

                  Please ensure Calculate on bar close for the indicator is not currently set to True. To check for this, you will want to right-click on your chart and select Indicators. Select your indicator and check the Calculate on bar close parameter.

                  Can you please clarify if you are submitting orders to the Sim101 account or that demo account? Any positions held will show up in the Positions tab of the Control Center.
                  Zachary G.NinjaTrader Customer Service

                  Comment


                    #10
                    It says that its trading through the Sim101 account on the orders tab. However, for some odd reason it wont let me change.

                    Also I was wondering if your able to have the Trading strategy to do transactions off the percentage of your total equity. I.E. If I have 50,000$ and i want to use 80% it will do 40,000$ in transactions and from there win or losing it will automatically adjust how much to put based on the new equity.

                    I also figured a way to fix the Renko Gaps, I created a custom session template so that, it will only do it when its closed for the weekends. I put start date from sunday to friday. just in future reference in case anyone is wondering. Works alot smoothly now as well.
                    Last edited by cnikitopoulos94; 08-31-2015, 03:48 AM.

                    Comment


                      #11
                      Hello Christos,

                      If you are using a sim license key, you will not be able to switch between accounts and can only trade on the Sim101 account.

                      If you are using a live license key on your platform, ensure that Global Simulation Mode is unchecked. You can find this option in the File menu of the NinjaTrader Control Center.

                      You could use the GetAccountValue() method call to get the value of the account the strategy is running on: http://ninjatrader.com/support/helpG...countvalue.htm

                      From there, you can calculate the percentage of the account value you wish to trade with and divide that by the price of the instrument to determine the amount of shares to trade, as an example.

                      Please, let us know if we may be of further assistance.
                      Zachary G.NinjaTrader Customer Service

                      Comment


                        #12
                        is there anyway i can use fxcm demo account? I registered through fxcm to get ninja trader and use their account to trade with ninja trader. However it doesnt show me the correct capital or real spreads or transaction costs.

                        Comment


                          #13
                          Hello Christos,

                          You will not be able to switch to another account without a live license key. You will only be able to trade on the Sim101 account.

                          You can set up commissions by going to Tools > Options in the NinjaTrader Control Center and selecting the Commission tab.

                          Below is a link to the Commission Tab section of our help guide:


                          Once you have set up the commission, please go to Tools > Options > General tab, check the box for 'Apply commissions to PnL calculations' and press OK.

                          Please note that these commissions won't be added to already existing trades.
                          Zachary G.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by andrewtrades, Today, 04:57 PM
                          1 response
                          5 views
                          0 likes
                          Last Post NinjaTrader_Manfred  
                          Started by chbruno, Today, 04:10 PM
                          0 responses
                          3 views
                          0 likes
                          Last Post chbruno
                          by chbruno
                           
                          Started by josh18955, 03-25-2023, 11:16 AM
                          6 responses
                          436 views
                          0 likes
                          Last Post Delerium  
                          Started by FAQtrader, Today, 03:35 PM
                          0 responses
                          7 views
                          0 likes
                          Last Post FAQtrader  
                          Started by rocketman7, Today, 09:41 AM
                          5 responses
                          19 views
                          0 likes
                          Last Post NinjaTrader_Jesse  
                          Working...
                          X