Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Price Alerts configured from file

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

    Price Alerts configured from file

    I coded an alert system which is configured by a file. It's of questionable usefulness but scratches my itches.
    Alerts are triggered as long price stays above or below a certain value and is delayed by a rearm time.
    It's simpler than the market analyzers alerts yet a bit more complex than the price alert indicator.


    Unfortunately one error in the configuration xml can disable the whole system so be careful or check the output window.

    The reason why i use a configuration file is that changing the price alert indicator would have reset the volume profile.

    If i feel like it i might add lines showing at which price level the alerts are trigger somewhen later. Probably should despaghettify the parsing code as well.

    Have fun.
    Attached Files
    Last edited by Rollins; 11-02-2007, 06:46 AM.

    #2
    Probably should despaghettify the parsing code as well.
    I didn't see any code.

    Best regards,

    KBJ

    Comment


      #3
      Just in case if the code is not available via NT here's the original.

      Cheers
      Attached Files
      Last edited by Rollins; 11-02-2007, 06:46 AM.

      Comment


        #4
        Looks interesting. What do I need to tell it to make it work?

        Guess I'm asking for a manual (then you could tell me to RTFM ).

        Best regards,

        KBJ

        Comment


          #5
          Ok here is how it works:

          "Indicator" configuration in NT (see attachement):

          ParameterFile -> path of the configuration file on the disk (sorry no file chooser)
          ParameterGroup -> name of the group to which the alert belongs
          ParameterName-> name of the alert

          Choosing another panel might be a good idea, file names can be very long.

          config file, use mine as a template (comments are in red, they don't belong into the config file, strip em or use the config.txt):

          <?xml version="1.0" encoding="UTF-8"?>
          <config>
          <alerts enabled="0"> #0 all alerts disabled, 1 all alerts enabled
          <group name="EC" enabled="1"> #0 all group alerts disabled, 1 all group alerts enabled
          <alert name="Above"> #name of the alert
          <price>1,4270</price> #price that triggers the alert
          <enabled>1</enabled> #0 alert disabled, 1 alert enabled
          <rearm>10</rearm> #trigger alarm again after x seconds if price is still above/below level
          <type>above</type> #check if price is above/below/equal/not equal to trigger
          <message>EC Up</message> #message string will appear in alert window
          <soundFile>C:\dl\media\audio\sound\edit\ECUpAlert.wav</soundFile> #path of the sound file to play
          </alert>
          <alert name="Below">
          <price>1,4255</price>
          <enabled>1</enabled>
          <rearm>10</rearm>
          <type>below</type>
          <message>EC Down</message>
          <soundFile>C:\dl\media\audio\sound\edit\ECDownAler t.wav</soundFile>
          </alert>
          </group>
          </alerts>
          </config>


          Hope the explanation is sufficient.

          Cheers
          Attached Files
          Last edited by Rollins; 11-02-2007, 06:47 AM.

          Comment


            #6
            How to remove this indicator, I can't see it in Edit Ninjascript Indicator, but I can see it in Chart->Indicators, when I re-import, still it doesn't show, when I try to remove Ninjascript Assembly, it says there is dependency to this indicator.

            I know this indicator exists, but how can I remove this, so I can also remove the dll.

            Thanks

            Comment


              #7
              You will most likely need to do the reverse of this: http://www.ninjatrader-support.com/H...ndicators.html
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                If I delete the reference and compile it, I get multiple lines of error.
                If I delete the reference and close it, I get error when I want to import ninjascript.

                I think, it's hidden somewhere.
                Attached Files

                Comment


                  #9
                  After you remove the dll you need to delete the .cs file.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Hi mason !

                    Originally posted by mason View Post
                    ... when I try to remove Ninjascript Assembly, it says there is dependency to this indicator.
                    What exactly is the error message which is shown, when you try to remove the NinjaScript Assembly ? Can you please post the screenshot ?

                    You can look into the trace file for this day. At the timestamp you tried to remove the assembly, there is written the compiler error, why the remove doesn't work (which file gets compiler errors because the assembly would be deleted).

                    You should always use the 'Remove NinjaScript Assembly' menu item, this should work properly.

                    As fallback, I suggest:
                    - remove reference to assembly (NinjaScript editor -> right click -> References)
                    - don't compile, shut down NinjaTrader
                    - remove manually the files <user folder>\My Documents\NinjaTrader 6.5\bin\Custom\PriceAlertFile.dll and <user folder>\My Documents\NinjaTrader 6.5\bin\Custom\PriceAlertFile.cs
                    - open NT
                    - open NinjaScript editor on some indicator and press F5.

                    You don't see the file in Edit Ninja Script, because it's in the assembly, and you don't can't edit the source code, for that, it isn't shown.

                    Hope, that helps,
                    Christian
                    ChristianSenior Software Developer

                    Comment


                      #11
                      I will let you know later, because it require shut down.

                      thanks

                      Comment


                        #12
                        - remove reference to assembly (NinjaScript editor -> right click -> References)
                        - don't compile, shut down NinjaTrader
                        - remove manually the files <user folder>\My Documents\NinjaTrader 6.5\bin\Custom\PriceAlertFile.dll and <user folder>\My Documents\NinjaTrader 6.5\bin\Custom\PriceAlertFile.cs
                        - open NT
                        - open NinjaScript editor on some indicator and press F5.
                        I have done it twice to make sure that I didn't do mistake, but I still get error.

                        If I remove ADL indicator, it will show in next indicator which is ADX.

                        As far as trace file, here it goes

                        First loading with dll file
                        2008-06-14 07:24:15:125 Loading D:\My Documents\NinjaTrader 6.5\bin\Custom\NinjaTrader.Custom.dll...
                        2008-06-14 07:24:15:203 Loading D:\My Documents\NinjaTrader 6.5\bin\Custom\NinjaTrader.Vendor.dll...
                        2008-06-14 07:24:15:250 Loading 3rd party D:\My Documents\NinjaTrader 6.5\bin\Custom\PriceAlertFile.dll...
                        Second loading without dll file, most indicators are not accessible from chart menu
                        2008-06-14 07:25:26:859 Loading D:\My Documents\NinjaTrader 6.5\bin\Custom\NinjaTrader.Custom.dll...
                        2008-06-14 07:25:26:937 Loading D:\My Documents\NinjaTrader 6.5\bin\Custom\NinjaTrader.Vendor.dll...
                        2008-06-14 07:25:26:984 Creating user defined methods files...
                        2008-06-14 07:25:27:000 Instantiating serializers...
                        2008-06-14 07:25:41:531 Registering chart styles...
                        2008-06-14 07:25:41:828 Registering bars types...
                        2008-06-14 07:25:50:546 ERROR: Failed to restore indicator 'NinjaTrader.Indicator.WMA'. Most likely (a) the implementation changed or (b) one or more properties have been renamed or removed or (c) the custom assembly which implements this indicator no longer is there.
                        2008-06-14 07:25:50:546 ERROR: Failed to restore indicator 'NinjaTrader.Indicator.WMA'. Most likely (a) the implementation changed or (b) one or more properties have been renamed or removed or (c) the custom assembly which implements this indicator no longer is there.
                        2008-06-14 07:25:50:546 ERROR: Failed to restore indicator 'NinjaTrader.Indicator.WMA'. Most likely (a) the implementation changed or (b) one or more properties have been renamed or removed or (c) the custom assembly which implements this indicator no longer is there.
                        Now I am back to with this indicator and its dll, I am not really bothered, it's just I don't like it always load in the first time, I want clean install, maybe when I have time, I will re-install from all over again.

                        But, have you try to import and remove this successfully ?
                        Attached Files

                        Comment


                          #13
                          Christian will get back to you on Monday.

                          Comment


                            #14
                            Hi Mason !

                            Thanks for the helpful screenshots and your expanations !

                            In the 3rd screenshot (references in NinjaScript editor) I see you reference the 'NinjaTrader.Custom.dll'. Please remove this reference. After that everything should work as expected again. So you can remove the price alert assembly.

                            Kind regards,
                            Christian
                            ChristianSenior Software Developer

                            Comment


                              #15
                              Christian,

                              Thanks, it works.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by fernandobr, Today, 09:11 AM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by timmbbo, Today, 08:59 AM
                              1 response
                              2 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by KennyK, 05-29-2017, 02:02 AM
                              2 responses
                              1,281 views
                              0 likes
                              Last Post marcus2300  
                              Started by itrader46, Today, 09:04 AM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by bmartz, 03-12-2024, 06:12 AM
                              5 responses
                              33 views
                              0 likes
                              Last Post NinjaTrader_Zachary  
                              Working...
                              X