Announcement

Collapse
No announcement yet.

reloading

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

  • reloading

    Is there a way to auto-reload an EFS? Maybe every bar or every other bar? Or maybe a way to create an icon that you can link to an EFS for reload? It would help clean up false signals on the chart

    Thanks

  • #2
    Hello jvesto,

    The ability to reload a formula via an EFS function may be added to a future release. To quickly reload your formula for now, simply right-click on your chart and select "Reload." Then select the formula you wish to reload.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Hi,

      can you explain what you are trying to do? False signals from what, drawn how, etc...

      There may be another way of handling this.

      Garth
      Garth

      Comment


      • #4
        reloading

        Garth-
        For example an MACD EFS that draws an up or down line when the signal line is crossed. At the bar of crossing you get multiple up/down arrows as the MACD tries to figure out what it is going to do. Only after reloading on the next bar (or sometimes several after) do you get the true direction. The result is a bunch of false signals that can only be cleared up by reloading. I was asking if there was a way to auto reload the EFS or create an icon that you can hit every so often to get the correct reading. How do other people deal with this?

        thanks
        jim

        Comment


        • #5
          Jim,

          I would think about the following solutions:

          1) Don't draw any arrows until NEWBAR
          2) If you want the signal arrows before the bar close, then
          keep track of all the unique labels you are writing for that bar and delete them using those labels.

          Garth
          Garth

          Comment


          • #6
            reloading

            Garth-

            I understand point 1. but I do want the sign as early as possible, even if the first signal is not the correct one. (at least I know it is close to crossover). I don't understand point 2?

            but all I'm looking for is a more streamline way to reload.

            thanks
            jim

            Comment


            • #7
              1) Don't draw any arrows until NEWBAR
              2) If you want the signal arrows before the bar close, then
              keep track of all the unique labels you are writing for that bar and delete them using those labels.

              I have done something close to this by doing the following -

              if getbarstate()==new_bar bar=bar+1

              drawstuf(...,bar)

              This way only one image is drawn per bar and the chart does not get cluttered up with many images superimposed on top of on another, which could happen without the getbarstate check.

              Comment


              • #8
                When you draw lines, shapes, etc (via Drawxxx()) in EFS you are supposed to generate a unique label for them (the last parameter I think). These labels can be used to delete these lines/shapes/images via removeXXX().

                So DrawLine() would would use removeLine(), etc. removeXXX() has a single paramter which is the unique label used when creating the line.

                DrawLine(x,y,x1,y1,...,MyLabel);
                .
                .
                .
                removeLine(MyLabel);

                So if you kept track of all the larraows used for one bar, you could then delete them all once the newbar has formed and draw the correct arrow.

                Garth
                Garth

                Comment


                • #9
                  reloading

                  I think you guys left me at the bakery.... I'm not that technically savvy

                  I've attached the EFS I'm talking of, is it a simple fix?

                  thanks
                  Attached Files

                  Comment


                  • #10
                    try this for starters
                    Attached Files

                    Comment


                    • #11
                      reloading

                      Got it, thanks. I guess I'll have to see if this works in real time, but if I'm understanding this newbar state, does this mean that the first time something is drawn it is then passed over? What if the first signal is wrong?

                      thanks
                      jim

                      Comment


                      • #12
                        Did David's mod do what you wanted? Looking at the code my guess is that it only printed the arrows on the close of a bar...
                        Garth

                        Comment


                        • #13
                          reloading

                          David's MOD did solve the problem of multiply arrows being drawn, however it still doesn't solve the false signal problem. On 5 min charts for example the MACD may cross (giving a signal) at the open but by the close of the bar it has not re crossed and the trend continues, so if I didn't "reload" the MACD X EFS I would not have know this (unless I have the MACD indicator up) So, what I'm looking for is a routine or something that will reload an EFS at the end of each bar?

                          Jim

                          Comment


                          • #14
                            reloading

                            Or better yet, maybe an icon on the advance chart toolbar that will reload all EFS for that chart?

                            Jim

                            Comment


                            • #15
                              Graphics issues...

                              You are running your script in RT - thus, when the indicator reaches your entry condition - the arrow is drawn - right??

                              I have overcome this problem using a couple of tricks...

                              1. Change your EFS to ...

                              setComputeOnClose(true);

                              and adjust your indicators to look one bar back (-1).

                              2. Use a "Time-Stamp" to find out if the previous bar has closed (finished). Time-Stamps are simple... you declare a variable (ie:EntryTriggerTime = 0, then check the current bar's time against your last recorded time. This allows you to execute one entry trigger (or any action) for any bar...

                              example..

                              var EntryTriggerTime = 0;

                              function main()
                              {

                              if ((getCurrentBarIndex() == 0) && EntryTriggerTime != getValue("rawtime",-1))) {
                              // Current RT Bar.
                              if ((YourEntrySignal)() {
                              // Check the previous bar's indicators for your entry trigger and check to verify if we had not issued a previous trigger on that bar.

                              }
                              // Record the new trigger entry date.
                              EntryTriggerTime = getValue("rawtime",-1))
                              }
                              }

                              This should stop your code from triggering an entry signal as the market moves and wait for the bar to complete, then check for the entry trigger, then wait for the next new bar...

                              Hope this helps..
                              Brad Matheny
                              eSignal Solution Provider since 2000

                              Comment

                              Working...
                              X