Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EMA Color Crossover

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

    EMA Color Crossover

    I remember I found and downloaded this indicator from this forum. I want to read the source code to learn how to write. But the source code does not look right. So I tried to import it again. It failed and got an error.

    I try to download it again, but I could not find it in this forum again. I attach a picture of this indicator. Can someone help?
    Attached Files

    #2
    GM Ben, have you checked already through the sharing posts on this topic?

    BertrandNinjaTrader Customer Service

    Comment


      #3
      Yes. I did read through 6.5 and 7.0 indicators. I do not find the one that I indicated.

      For some reason, I can still use it (compiled code) and set it up on the chart. But I cannot import it again from the zip file. I am concerning if I need to transfer my work to another computer, I cannot set up this indicator again. if I know C## language, it should be simple logic. But I do not know this language at this moment. I will try to see if I can model from other similiar indicators and then make changes by myself.

      Thank you for searching.

      Comment


        #4
        I guess I'm not exactly following what the issue then is - if you still have access to the source code then you could review it on your platform and for example save to a new file from the editor to be able to modify it further, or did you make already changes and now you could not compile anymore?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          The following are the two closest that match your criteria





          All you need to do is add an 'If' clause at the end of the script ....

          something like 'If rising....' ......'color the plot red ....'

          Examples

          // Initialize method of a custom indicator
          protected override void Initialize()
          {

          // Lines are added to the Lines collection in order
          Add(new Plot(Color.Orange, "Plot1")); // Stored in Plots[0]
          Add(new Plot(Color.Blue, "Plot2")); // Stored in Plots[1]
          }



          // Dynamically change the primary plot's color based on the indicator value

          protected override void OnBarUpdate()

          {

          if (Value[0] > 70)

          Plots[0].Pen = new Pen(Color.Blue);

          else

          Plots[0].Pen = new Pen(Color.Red);

          }
          Last edited by stocktraderbmp; 03-10-2012, 02:39 PM.

          Comment


            #6
            Thank you stocktraderbmp, Bertrand.

            I try to import MACrossBuilder.zip, there is a message:
            "You have custom NinjaScript files on your PC that have programming errors. These errors must be resolved before you can import a NinjaScript Archive File."

            So I use editor to pull up a valid indicator to compile. And the error message indicated that there are programming error in EMA_Color_Crossover script.

            I think if I use some other valid script to put it into EMA_Color_Crossover script to fool the compiler, I will resolve the programming error. But it will also affect the chart I am using. So I did not carry on.

            I have downloaded many scripts from this forum. Most of them I was able to import, view the source, set up on chart. I was also able to modify some of them to tailor to my needs. There were some scripts I was not able to import and I simply do not try them. This EMA_Color_Crossover is an isolated case. I found the zip file in the download target folder [indicator]. But I do not find the .cs file in the same folder. Usually after I import successfully, the .cs file is also located in the same folder. After searching for a while, I found this .cs file and .dll file in the upper level folder [Custom]. See attached.

            When I set up my chart, I right click and select [indicator], I find this indicator EMA Color Crossover, so I select it and use it on my chart. And you can see that diagram I attached in my first message. I do not know how it gets in there.

            I upload the .cs file and zip file. If you are interested, you can try to import to see what happens. The .cs file seems to have coding missing. Those missing coding are usually the portion I learn or modify.

            I do not know C## or this kind of technology, so I could not explain what exactly happened.

            I know many of the members can easily fill out the missing code or write this script. If the missing code is supplied, I may be able to copy and paste in my .cs file and try to recompile.

            For now, I cannot import and recompile anything.
            Attached Files

            Comment


              #7
              Benluk;

              If you open the indicator wizard to create a new indicator and try to compile it straight away it should come up with the same error message but at the bottom of the window it will tell you which indicators have the errors.
              You will then have to either correct the errors or delete the indicators / strategies. First copy them to a memory stick and copy the code to say notepad. Then delete them all from your computer. You will then be able to import whatever you wish until the error is resolved. I believe it is unusual to have indicators stored in that particular file - as I'm sure your aware they should be in the indicators file - maybe their is a reason for this that support can resolve.
              I have had a look at the code for the crossover indicator and it is obviously converted from an earlier version of NT. I am not familiar with the earlier versions or the indicators so best I leave the resolution of this problem to the support team.
              The code appears very long winded and unnecessarily complex as you would easily be able to code a new indicator that does exactly the same thing as this but with about 5 lines of code.
              Is this indicator a 3rd party vendors? If so you will have to go back to them. I am unable to import the indicator / code myself.
              Sorry I can't be more help.

              Comment


                #8
                Thank you stocktraderbmp.

                Backup the files related to this indicator (like zip, cs, dll, etc), then delete them from my computer. Do you mean deleting those files from custom folder as well as from indicator folder? Then I should be able to carry on other imports and compiles?

                If I do it that way, I am concerning if it will affect my chart. When I right click on a chart and select indicator, will this indicator still be there for me to use? If not, I bring back the backup to its original folder, will it work again?

                Although writing that 5 lines of coding might be simple for most members here, it is not easy to me. I am afraid if I lost it, I will not get it back.

                The indicator in fact is just 2 EMAs. It creates an visual effect that is easy to see on the chart. See attached. That is why I want to save it.
                Attached Files

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bmartz, 03-12-2024, 06:12 AM
                3 responses
                25 views
                0 likes
                Last Post NinjaTrader_Zachary  
                Started by Aviram Y, Today, 05:29 AM
                2 responses
                7 views
                0 likes
                Last Post Aviram Y  
                Started by gentlebenthebear, Today, 01:30 AM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by cls71, Today, 04:45 AM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by TradeForge, Today, 02:09 AM
                1 response
                23 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X