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

Blttriggerlines Strategy

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

    Blttriggerlines Strategy

    I am trying to build a stagey with the Blttriggerlines indicator. It will not compile. I am getting an error on these three lines.
    public enum MAType { EMA, HMA, SMA, TMA, VMA, WMA, DEMA, TEMA, VWMA, ZLEMA, LinReg }
    public enum ColorStyle { Transparent, RegionColors, CustomColors, PlotColors }
    public class BltTriggerLines : Indicator
    Attached Files

    #2
    Originally posted by Nightmaregpu View Post
    [FONT=Calibri]I am trying to build a stagey with the Blttriggerlines indicator. It will not compile. I am getting an error on these three lines.
    public enum MAType { EMA, HMA, SMA, TMA, VMA, WMA, DEMA, TEMA, VWMA, ZLEMA, LinReg }
    public enum ColorStyle { Transparent, RegionColors, CustomColors, PlotColors }
    public class BltTriggerLines : Indicator
    What errors are you getting?
    Please post a screenshot of the error message.

    If you've made a copy of BltTriggerLines.cs and named it BLTtest.cs,
    you need to make changes inside BLTtest.cs to avoid compiler errors
    related to duplicate names.

    In BLTtest,cs, change the name of the class to "BLTtest".
    In BLTtest.cs, comment out the 5 lines for the BltTriggerLines.Common namespace.

    This should fix the errors for duplicate class name and duplicate enum name,
    which, I presume, is the errors you were seeing.

    Comment


      #3
      Sorry that was a backup on the bltTriggerLines.cs. I changed it. This is the error I am getting.
      Attached Files

      Comment


        #4
        Thanks for the screenshot.

        It doesn't matter which file you edit, you have to
        change one of them to avoid the duplicate errors.

        The compiler is reporting it found a duplicate class
        name and duplicate enum name.

        Why is that?
        Because you created BLTtest.cs, as an exact copy
        of BltTriggerLines.cs, and left it in the Indicators folder,
        or subfolder, and it is that action on your part that has
        now caused the error.

        Don't just copy a file to a new filename and leave it in
        the Indicators folder. That is not how to make a backup.


        If you want a backup of BltTriggerLines.cs, just copy the file
        to another folder, outside of NinjaTrader, or use the builtin
        NinjaTrader Backup command.

        It appears you are trying to make duplicate of an indicator,
        but this is actually a multi-step process and what you've done
        so far is incomplete -- you're missing some extra steps.

        What extra steps?
        Go back and read my other post on how to fix it.

        Or, delete BLTtest.cs and start over, try reading this and
        this first.

        I looked around for an official "How To ..." on doing this, I
        thought NT Support had one in their Tips section under
        Educational Resources, but I can't find it. Bummer.

        Hang in there...

        Last edited by bltdavid; 12-14-2021, 02:28 PM.

        Comment


          #5
          In post #2, I recommended you make these changes -- see attached.

          You shouldn't make edits to your pristine originals, so don't edit the
          actual BltTriggerLines.cs -- just edit your copy in BLTtest.cs -- that's
          the file you're playing with in your testing, right?
          Attached Files
          Last edited by bltdavid; 12-14-2021, 01:00 PM.

          Comment


            #6
            I will do that. Thanks!

            Comment


              #7
              Did anyone ever get this to work in Strategy Builder?
              It absolutely refuse to compile.

              Comment


                #8
                Originally posted by notenufftime View Post
                Did anyone ever get this to work in Strategy Builder?
                It absolutely refuse to compile.
                Welcome to the forums!

                What are the error messages?
                Can you post a screenshot?

                Comment


                  #9
                  Hello ntenufftime,

                  Welcome to the NinjaTrader Forums and thanks for your post!

                  How are you using the indicator in a Strategy Builder strategy?

                  What exactly does the compile error report when you open a New > NinjaScript Editor window and click the 'Compile' button to run a compile?

                  If possible, please send a screenshot showing how you are using the indicator in the condition and a screenshot showing what the full error message is so I may accurately assist.
                  • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
                  • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save it as a jpeg file and send the file as an attachment.
                  Brandon H.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by bltdavid View Post

                    Welcome to the forums!

                    What are the error messages?
                    Can you post a screenshot?
                    Hi and thank you for the warm welcome.
                    My apologies for the slow reply, I don't check here often. I had abandoned my efforts in trying to make this work and have moved on, however, I am still interested to see how it can perform and I am always so disappointed when threads don't have an ending, a resolution. Let's please see where this goes.

                    The error message is that Ninja 'Could not compile NinjaScript'
                    Click image for larger version

Name:	image.png
Views:	398
Size:	3.9 KB
ID:	1258924
                    I had worked through any of the fixes I could find. There was an update available that changed the first letter to capitals that would fix it but did not. There was a thread about editing the script which only resulted in no error during compiling but still no executions while running the strategy.

                    What do you think?​

                    Comment


                      #11
                      Originally posted by NinjaTrader_BrandonH View Post
                      Hello ntenufftime,

                      Welcome to the NinjaTrader Forums and thanks for your post!

                      How are you using the indicator in a Strategy Builder strategy?

                      What exactly does the compile error report when you open a New > NinjaScript Editor window and click the 'Compile' button to run a compile?

                      If possible, please send a screenshot showing how you are using the indicator in the condition and a screenshot showing what the full error message is so I may accurately assist.
                      • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
                      • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save it as a jpeg file and send the file as an attachment.
                      Hi NinjaTrader_BrandonH

                      Thank you for the welcome and again, my apologies for the delinquent reply.

                      It doesn't matter how I use the indicator in a strategy, the simplest action results in a compiling error.

                      Click image for larger version

Name:	image.png
Views:	401
Size:	3.9 KB
ID:	1258926

                      As I mentioned above to bltdavid, I had abandoned this indicator in strategies, but I can see how it may be beneficial and I would like to resolve this for anyone who may be trying in the future. I have seen multiples threads about exactly the same issue.

                      I created a quick strategy to create the error for posting just now. It is incredibly simple, when trigger cross above enter long and when trigger crosses below enter short.

                      There are no other indicators involved.

                      What do you think?​

                      Comment


                        #12
                        Hello notenufftime,

                        Thank you for your reply.

                        It seems like we might need additional context to get to the bottom of this. You previously mentioned this was happening with the Strategy Builder, correct? I do suspect this may still have to do with duplicate names somewhere within the script. Although this post is a little bit dated, a user was experiencing a similar error and said it was related to naming conventions:
                        Hello, See Image Attached... I'm getting an error on creating or editing a strategy.. This is something I haven't seen lately.. After it pops up the NinjaScript Editor pops too, but I can't find anywhere where the error is, so I can't fix the problem.. Looking at my strategy there shouldn't be a problem.. But it's saying


                        If possible, please provide the exact script you are working with along with the steps to produce the error with creating the cross above enter long/cross below enter short strategy so we may test this on our end as well.

                        We look forward to assisting you further.
                        Emily C.NinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_Emily View Post
                          Hello notenufftime,

                          Thank you for your reply.

                          It seems like we might need additional context to get to the bottom of this. You previously mentioned this was happening with the Strategy Builder, correct? I do suspect this may still have to do with duplicate names somewhere within the script. Although this post is a little bit dated, a user was experiencing a similar error and said it was related to naming conventions:
                          https://forum.ninjatrader.com/forum/...14#post1075614

                          If possible, please provide the exact script you are working with along with the steps to produce the error with creating the cross above enter long/cross below enter short strategy so we may test this on our end as well.

                          We look forward to assisting you further.
                          Hi NinjaTrader_Emily

                          Thank you for your interest.

                          You are correct in your assumption of strategy builder. Which script is it that you are after?

                          The strategy has been made as simple as possible for this purpose. I am using bltdavid​'s Triggerlines and only that. During my setup I've used all defaults of the indicator and my strategy is very base.

                          When Trigger crosses above average - Enter Long
                          When Trigger crosses below average - Enter Short

                          What could go wrong? Haha

                          Compile does not complete, and an error message is generated as indicated. That is a direct screen shot.

                          When I had been pursuing it, I found an updated version of BLTTrigger, installed it and the same error presented. I read and followed a thread about manually changing some references in the indicator. I followed them and was able to compile both the indicator and the strategy without errors, however, no activity would take place when running it.
                          No errors, but no actions (Enter Long\Short).

                          That's all there is to it.

                          Comment


                            #14
                            Hello notenufftime,

                            Thank you for that information.

                            I would like to view your diagnostic files and possibly set up a remote support session with you. Please send your files to us from the platform. You can do this by going to the Control Center-> Help-> Email Support Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default. Please include "ATTN Emily C" in the subject and body of the email prior to clicking send so the message will be routed to me.

                            I look forward to assisting you further.​
                            Emily C.NinjaTrader Customer Service

                            Comment


                              #15
                              Hi Emily C.

                              That sounds like a lot of effort for an abandoned strategy. All other indicators that I use in strategies work spectacularly well and I've seen other posts about BltTriggerLines not being useable in the same way. I thank you very much for your reply, but it is not necessary to go through that.

                              My best regards...

                              notenufftime

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by burtoninlondon, Today, 12:38 AM
                              0 responses
                              10 views
                              0 likes
                              Last Post burtoninlondon  
                              Started by AaronKoRn, Yesterday, 09:49 PM
                              0 responses
                              14 views
                              0 likes
                              Last Post AaronKoRn  
                              Started by carnitron, Yesterday, 08:42 PM
                              0 responses
                              11 views
                              0 likes
                              Last Post carnitron  
                              Started by strategist007, Yesterday, 07:51 PM
                              0 responses
                              14 views
                              0 likes
                              Last Post strategist007  
                              Started by StockTrader88, 03-06-2021, 08:58 AM
                              44 responses
                              3,983 views
                              3 likes
                              Last Post jhudas88  
                              Working...
                              X