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

Gann HiLo Activator, is it possible?

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

    Gann HiLo Activator, is it possible?

    Hi all

    I am looking to move over from Metatrader to Ninja Trader in the forthcoming week as my broker supports this application.

    However, one of the indicators I use in my strategy is the Gann HiLo Activator.

    I can post the mql4 code if need be but my question originally was if it is possible to code the same as a custom indicator in Ninja Trader?

    Any pointers would be most welcome.

    Adi

    #2
    I am not familiar with this indicator but what I can say is that anyting can be programmed in NinjaScript. You can check our NinjaScript File Sharing section to see if this indicator already exists, if not please post the MQL4 code so everyone can take a look.
    RayNinjaTrader Customer Service

    Comment


      #3
      Here is the indicator in MQL4

      Hi there

      Many thanks for your reply. It is comforting to know that I will not lose out on the migration over to Ninja trader.

      Here is the code:




      #property copyright "Poul Trade Forum"
      #property link "http://forex.kbpauk.ru/"
      #property indicator_chart_window
      #property indicator_buffers 3

      #property indicator_color1 Blue
      #property indicator_color2 Red
      #property indicator_color3 Navy


      //---- input parameters
      extern int R=10; // default value for auslanco system
      extern bool dots=false;
      extern bool line=true;

      //---- buffers
      double HighBuffer[];
      double LowBuffer[];
      double LineBuffer[];
      double VALUE1,VALUE2,VALUE11,VALUE22;
      //+------------------------------------------------------------------+
      //| Custom indicator initialization function |
      //+------------------------------------------------------------------+
      int init()
      {
      string short_name;
      //---- indicator line
      if(dots)
      {
      SetIndexStyle(0,DRAW_ARROW,EMPTY,1,Blue);
      SetIndexStyle(1,DRAW_ARROW,EMPTY,1,Red);

      SetIndexArrow(0, 0x9F);
      SetIndexArrow(1, 0x9F);

      SetIndexBuffer(0,HighBuffer);
      SetIndexBuffer(1,LowBuffer);

      SetIndexEmptyValue(0,0);
      SetIndexEmptyValue(1,0);
      }
      if(line)
      {
      SetIndexStyle(2,DRAW_LINE,EMPTY,2,Navy);
      SetIndexBuffer(2,LineBuffer);
      SetIndexEmptyValue(2,0);
      }
      //---- name for DataWindow and indicator subwindow label
      short_name="HiLoV2";
      IndicatorShortName(short_name);
      SetIndexLabel(0,short_name);

      //----
      SetIndexDrawBegin(0,10);
      //----

      return(0);
      }
      //+------------------------------------------------------------------+
      //| Custor indicator deinitialization function |
      //+------------------------------------------------------------------+
      int deinit()
      {
      //---- TODO: add your code here
      ObjectsDeleteAll(0);
      //----
      return(0);
      }
      //+------------------------------------------------------------------+
      //| Custom indicator iteration function |
      //+------------------------------------------------------------------+
      int start()
      {
      int counted_bars=IndicatorCounted(),i,shift,Swing;


      //---- TODO: add your code here
      i=(Bars-counted_bars)-1;

      for (shift=i; shift>=0;shift--)
      {


      VALUE1=iMA(NULL,0,R,0,MODE_SMA,PRICE_HIGH,shift+1) ;
      VALUE2=iMA(NULL,0,R,0,MODE_SMA,PRICE_LOW,shift+1);

      if (Close[shift+1]<VALUE2 ) Swing=-1;
      if (Close[shift+1]>VALUE1 ) Swing=1;
      if(dots)
      {
      if (Swing==1) { HighBuffer[shift]=VALUE2; LowBuffer[shift]=0; }
      if (Swing==-1) { LowBuffer[shift]=VALUE1; HighBuffer[shift]=0; }
      }
      if(line)
      {
      if (Swing==1) { LineBuffer[shift]=VALUE2; }
      if (Swing==-1) { LineBuffer[shift]=VALUE1; }
      }


      //----
      }
      return(0);
      }
      //+------------------------------------------------------------------+




      Thanks again


      Adi
      Last edited by freeka; 10-26-2008, 07:48 AM. Reason: Typo

      Comment


        #4
        I will pass this on to one of our techs who have MT experience to see if this is something he could tackle as a learning experiment.
        RayNinjaTrader Customer Service

        Comment


          #5
          Thank you for your help, much appreciated!

          Comment


            #6
            Originally posted by freeka View Post
            Thank you for your help, much appreciated!
            Look in here, http://www.ninjatrader-support.com/v...ight=activator

            Comment


              #7
              Hello,

              This indicator has been added to our file sharing section if you are still interested.
              DenNinjaTrader Customer Service

              Comment


                #8
                how to find the indicator in file sharing section ?

                Originally posted by NinjaTrader_Ben View Post
                Hello,

                This indicator has been added to our file sharing section if you are still interested.
                how can I find the indicator in the file sharing section. I looked under the name of gann, nothing were there ? what should i do ? thanks

                Comment


                  #9
                  You can review the files shared in the 'Indicators' section - http://www.ninjatrader-support2.com/...splay.php?f=37
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Orginal version has loockback set to 10 bars before, but in mt4 version on indicator you can set this whatever you like - 4, 5, 15 bars back etc. Can you add that function to this Gann indicator, or can you tell me which line in code I need to change to get indi set to check 5 bars back?

                    Comment


                      #11
                      The simple answer is look in the Variables section for this line:

                      private int r = 10;

                      and change the 10 to 5 and compile. To add the option in the parameters settings takes a little more work.
                      eDanny
                      NinjaTrader Ecosystem Vendor - Integrity Traders

                      Comment


                        #12
                        So simple - thank you .

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by poplagelu, Today, 05:00 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post poplagelu  
                        Started by fx.practic, 10-15-2013, 12:53 AM
                        5 responses
                        5,407 views
                        0 likes
                        Last Post Bidder
                        by Bidder
                         
                        Started by Shai Samuel, 07-02-2022, 02:46 PM
                        4 responses
                        98 views
                        0 likes
                        Last Post Bidder
                        by Bidder
                         
                        Started by DJ888, Yesterday, 10:57 PM
                        0 responses
                        8 views
                        0 likes
                        Last Post DJ888
                        by DJ888
                         
                        Started by MacDad, 02-25-2024, 11:48 PM
                        7 responses
                        160 views
                        0 likes
                        Last Post loganjarosz123  
                        Working...
                        X