Announcement

Collapse
No announcement yet.

Great Idea for EFS!!!

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

  • #46
    function main(nVol){
    if(nVol==null)nVol=100;
    nTradeSize = getMostRecentTradeSize();
    if(getBarState==BARSTATE_NEWBAR)nTradeSize=0
    if(nTradeSize>=nVol)xVol=xVol+nTradeSize
    setPlotType( PLOTTYPE_HISTOGRAM, 0 );
    return xVol;
    }

    should plot the volume if the trade size is >=100 - user configurable too.

    Only works from the time the efs is loaded, i.e. does not back calculate the volume for yesterday

    Thanks for the books.

    Comment


    • #47
      quick edit

      function main(nVol){
      if(nVol==null)nVol=100;
      nTradeSize = getMostRecentTradeSize();
      if(getBarState==BARSTATE_NEWBAR)nTradeSize=0
      if(nTradeSize>=nVol)xVol=xVol+nTradeSize
      setPlotType( PLOTTYPE_HISTOGRAM, 0 );
      return xVol;
      }

      should plot the volume if the trade size is >=100 - user configurable too.

      Only works from the time the efs is loaded, i.e. does not back calculate the volume for yesterday

      Thanks for the books.

      Comment


      • #48
        New volume efs

        David,

        Thank you for working on this. Let me give it a try and see how it works. If I have found something that gives an edge then I will share with the group.

        John

        Comment


        • #49
          add

          var xVol;

          as the first line of the efs. Hard to tell if it works after hours, but it loads ok and looks ok.

          Comment


          • #50
            SInce I came up with the idea for the candlewaist.efs I was wondering if some could do a simple efs for me? It is just volume.efs with a line tracking the top of the bars so I can easily see the volume spikes. I would like to be able to change the thickness of the line and the bars if possible in the efs.

            This would be greatly appreciated!

            Thanks,

            Realm

            Comment


            • #51
              dloomis

              David (dloomis),

              You seem to be quite adept at writing EFS studies. I am trying to find out IF the following study could be written.

              1. Study name: "Bid/Ask Volume Ratio" or "Orderflow"

              2. Function: To plot as a histogram the contracts traded at the Bid vs the contracts traded at the Ask for the last bar/candle period - basically two histograms for each candle, green for contracts traded at the Ask and red for contracts traded at the Bid (a quick move of the curser over the histograms would provide the info in the curser window)

              3. Purpose: To see when the ratio of volume of trades at the Bid vs Ask change, especially at key Sup/Res levels

              Idealy if the bars/candles could be made based on contracts traded vs time or tick based bars/candles the volume profiling would be more detail - to always be able to see the ratio of trades at the Bid vs Ask for the last 500, 1000, 2000, etc, contracts traded could be an amazing tool for following order flow

              A friend of mine (who is not an Esignal user) had told me that he felt because the data would be based on detailed Time & Sales info it might choke the program.

              If you could kindly let me know if a study like this could be done in Esignal I would appreciate it.

              John M

              Comment


              • #52
                You seem quite adept at efs, blush blush

                However, you description of the volume at bid/ask histogram sounds very do-able.

                I think all the data is in eSignal for the mathematical massaging. Your friend seems correct.

                I doubt it would overwhelm the cpu, because the efs is no different than any other efs most of them work on every tick any way. (Unless you tell the efs other wise, the efs will run once every tick)

                Comment


                • #53
                  This must be close to what you want...

                  var bid;var ask;var last;var vBid; var vAsk;var vVol;var size_GT_0;var style_0_or_1;

                  function preMain(){
                  addBand(0, PS_SOLID, 2, Color.cyan );//drawsa centerline for easier visual demarkation
                  setPlotType( PLOTTYPE_HISTOGRAM, 0 ); //bid histogram
                  setPlotType( PLOTTYPE_HISTOGRAM, 1 ); //ask histogram
                  }

                  function main(size_GT_0, style_0_or_1){

                  //make sure size criteria is valid
                  if(size_GT_0==null)size=1;

                  //make sure style criteria is valid, style=0 for 2 histograms, style=1 for a ratio of the vBid and vAsk
                  if(style_0_or_1==null)style=0;

                  //if the next bar is starting, rest vars to zero
                  gbs=getBarState();
                  if(gbs==BARSTATE_NEWBAR){
                  vAsk=0;
                  vBid=0;
                  setBarFgColor(Color.lime,0);//this can only go in main() so I put it here to reduce cpu load, only executes once per bar, not every tick
                  setBarFgColor(Color.red,1);// ditto
                  }

                  bid=getMostRecentBid();
                  ask=getMostRecentAsk();
                  last=close();
                  vVol=getMostRecentTradeSize();

                  //if the last price was = to the bid, and the trade size meets the user criteria, add it up
                  if(last==bid && vVol>=size_GT_0)vBid=vBid+vVol;

                  //if the last price was = to the ask, and the trade size meets the user criteria, add it up
                  if(last==ask && vVol>=size_GT_0)vAsk=vAsk+vVol;

                  //if the last is different than the bid or ask, ignore it, right?

                  //return data in frmat desired
                  if(style_0_or_1==0)
                  return new Array(-vBid,+vAsk); // The minus sign plots the bid histogram below the zero line the ask histogram above.
                  //The plus sign is an extraneous and surpurfluous term which is not needed at all

                  if(style_0_or_1!=0)
                  return (vBid/vAsk);
                  }

                  Comment


                  • #54
                    try this efs. and you can modify it how you like. I would still appreciate it if someone could do that simple efs I asked about in my last post!

                    Thanks

                    Realm
                    Attached Files

                    Comment


                    • #55
                      Poiint me to volume.efs and I'll add the line you are looking for.

                      Comment


                      • #56
                        function preMain() {
                        setPriceStudy(false);
                        setStudyTitle("1z");
                        setCursorLabelName("v", 0);
                        setDefaultBarStyle(PS_SOLID, 0);
                        setDefaultBarFgColor(Color.red, 0);
                        setDefaultBarThickness(1, 0);
                        setPlotType(PLOTTYPE_HISTOGRAM, 0);
                        setPlotType(PLOTTYPE_LINE, 1);
                        }
                        function main(){
                        setBarFgColor(Color.lime,0);
                        debugPrintln(volume());
                        if (volume() > 3) return new Array( volume(), volume());
                        return;
                        }

                        Comment


                        • #57
                          Thanks thats almost exactly what i want I would like the volume bars to be 2 colors though one showing down volume , other show up volume (for example: donw bars are red and up bars are blue, and what lines in the efs allow me to change the thickness of the lines?


                          Thanks!

                          Realm

                          Comment


                          • #58
                            Here is a volumema efs
                            Attached Files

                            Comment


                            • #59
                              Ok if you can add a histogram to this it would be gret. I tried but, could'nt figure it out. I was able to add the bar thickness.

                              Sorry I am just in the beggining stages of learning how to code.

                              Thanks,

                              Realm
                              Attached Files

                              Comment


                              • #60
                                The volume Moving average in the volma2 efs is set at 10 days anyone can change this if they like inside the efs.

                                it is located on line 58

                                Realm

                                Comment

                                Working...
                                X