Announcement

Collapse
No announcement yet.

A little help please

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • A little help please

    Hi All

    I was wondering if someone could help me out on this EFS, I dont know whom wrote it or really anything about programing but it is really a great efs. I was wondering though, could someone help me out and tell me how I can put a box in edit studies to filter out the size of the trades going through. Instead of seeing every trade going through, I just want to see either 50 contracts of more or 100 contracts or more, it would be nice if I could enter a number that way I could open two up and see how both of the studies look. As always thanks for everyones help, I really think this could give a new look at this efs.
    Mark
    Attached Files

  • #2
    questions..

    do you want this filter to operate on all values (ask/bid/total)?
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Hi Brad

      Thanks so much for the reply, it woud be great to be able to get all three variables but if it is really difficult then just the bid and ask. The thing is that I dont want to be able to see the bid and ask totals for say 100 lot trades and then the total is way out of whack because it has all the totals for all the trades that went through so I would imagine that all three varible would have to work.
      thanks again for the help, really appreciate it.
      Mark

      Comment


      • #4
        I think you could put this statement in the main fuction:

        if( getMostRecentTradeSize() < 50 ) { then return } ;

        Of course, you would make it parameter driven:

        if( getMostRecentTradeSize() < iMinSize ) { then return } ;

        Is that what you wanted?

        HTH.

        Comment


        • #5
          Hi Buzz

          Hey I really appreciate the help truly, but I honestly dont know a thing about programing I dont know what the main funtion is, or the other terms you use. So I dont have a clue what you are asking.
          I probably could learn it, but I have another job and every waking moment I am literally studying to become a better trader.
          So maybe someday when I become profitable to quit my other job I can take the time to learn programming but in the mean time I am somwhat dependant on the kindness of others. iSo again appreciate everyones help.
          Mark

          Comment


          • #6
            There's already a TRADE VOLUME FILTER built in!!

            If you right click the chart and then click EDIT STUDIES, and select this study, you'll see the input parameter.

            The code is:


            var vTradeVol = vVol - vPrevVol;
            if (vTradeVol < nFilter) return aReturn;


            I assume it does the same as:


            if( getMostRecentTradeSize() < nFilter ) { return ; }

            I am not sure... I'll have to run some debug lines to find out.

            HTH.
            Attached Files

            Comment


            • #7
              TRO_bidaskanalysis

              I tested with Debug and there is a slight difference sometimes.

              On a tick chart, no difference.

              Here's my version:

              PHP Code:
              /****

              TRO_bidaskanalysis 12:31 PM 8/15/2006

              Modifying Programmer:  Avery T. Horton, Jr.  aka *************, 
                
              please include this and/or any other comment blocks and a 
              description of any changes you make.


              ****/


              /******************************


              Provided By : eSignal (c) Copyright 2004
              Description: Bid/Ask Analysis

              Version 2.0

              Notes:
              *** 2.0 - 11/26/2004 ***
                  - Added Trade Volume Filter.  Trade Volume less than the Filter
                    number will be excluded when Srouce is set to Volume.
                  - 5/27/05 - Fix for Trade Volume Filter.  Wasn't properly 
                    reseting the total at new bar.

              Formula Parameters:                 Defaults:
              Analysis                            Bar
                  [Bar, Cumulative]
              Study Output                        Raw Data
                  [Relative Percent, Raw Data]
              Source                              Volume
                  [Tick, Volume]
              Trade Volume Filter                 0
              Ask Color                           green
              Inside Color                        black
              Bid Color                           red
              Total Color                         lime
              Ask Thickness                       8
              Inside Thickness                    6
              Bid Thickness                       4
              Display Ask                         Yes
                  [Yes, No]
              Display Inside                      Yes
                  [Yes, No]
              Display Bid                         Yes
                  [Yes, No]
              Display Total                       Yes
                  [Yes, No]
              *********************************/

              function preMain() {
                  
              setStudyTitle("TRO_bidaskanalysis");
                  
              setCursorLabelName("Total"0);
                  
              setCursorLabelName("Ask %"1);
                  
              setCursorLabelName("Inside %"2);
                  
              setCursorLabelName("Bid %"3);
                  
              setDefaultBarFgColor(Color.lime0);
                  
              setDefaultBarFgColor(Color.green1);
                  
              setDefaultBarFgColor(Color.black2);
                  
              setDefaultBarFgColor(Color.red3);
                  
              setDefaultBarThickness(80);
                  
              setDefaultBarThickness(81);
                  
              setDefaultBarThickness(62);
                  
              setDefaultBarThickness(43);
                  
              setPlotType(PLOTTYPE_HISTOGRAM0);
                  
              setPlotType(PLOTTYPE_HISTOGRAM1);
                  
              setPlotType(PLOTTYPE_HISTOGRAM2);
                  
              setPlotType(PLOTTYPE_HISTOGRAM3);
                  
              setShowTitleParameters(false);
                  
              setStudyMin(0);
                  
                  var 
              fp0 = new FunctionParameter("sType"FunctionParameter.STRING);
                      
              fp0.setName("Analysis");
                      
              fp0.addOption("Bar");
                      
              fp0.addOption("Cumulative");
                      
              fp0.setDefault("Bar");
                  var 
              fp1 = new FunctionParameter("sOutput"FunctionParameter.STRING);
                      
              fp1.setName("Study Output");
                      
              fp1.addOption("Relative Percent");
                      
              fp1.addOption("Raw Data");
                      
              fp1.setDefault("Raw Data");
                  var 
              fp2 = new FunctionParameter("sSource"FunctionParameter.STRING);
                      
              fp2.setName("Source");
                      
              fp2.addOption("Tick");
                      
              fp2.addOption("Volume");
                      
              fp2.setDefault("Volume");
                  var 
              fp2a = new FunctionParameter("nFilter"FunctionParameter.NUMBER);
                      
              fp2a.setName("Trade Volume Filter");
                      
              fp2a.setLowerLimit(0);
                      
              fp2a.setDefault(0);
                  var 
              fp3 = new FunctionParameter("cAsk"FunctionParameter.COLOR);
                      
              fp3.setName("Ask Color");
                      
              fp3.setDefault(Color.green);
                  var 
              fp4 = new FunctionParameter("cInside"FunctionParameter.COLOR);
                      
              fp4.setName("Inside Color");
                      
              fp4.setDefault(Color.black);
                  var 
              fp5 = new FunctionParameter("cBid"FunctionParameter.COLOR);
                      
              fp5.setName("Bid Color");
                      
              fp5.setDefault(Color.red);
                  var 
              fp6 = new FunctionParameter("cTotal"FunctionParameter.COLOR);
                      
              fp6.setName("Total Color");
                      
              fp6.setDefault(Color.lime);
                  var 
              fp7 = new FunctionParameter("nAskThickness"FunctionParameter.NUMBER);
                      
              fp7.setName("Ask Thickness");
                      
              fp7.setDefault(8);
                  var 
              fp8 = new FunctionParameter("nInsideThickness"FunctionParameter.NUMBER);
                      
              fp8.setName("Inside Thickness");
                      
              fp8.setDefault(6);
                  var 
              fp9 = new FunctionParameter("nBidThickness"FunctionParameter.NUMBER);
                      
              fp9.setName("Bid Thickness");
                      
              fp9.setDefault(4);
                  var 
              fp10 = new FunctionParameter("sAskDisplay"FunctionParameter.STRING);
                      
              fp10.setName("Display Ask");
                      
              fp10.addOption("Yes");
                      
              fp10.addOption("No");
                      
              fp10.setDefault("Yes");
                  var 
              fp11 = new FunctionParameter("sInsideDisplay"FunctionParameter.STRING);
                      
              fp11.setName("Display Inside");
                      
              fp11.addOption("Yes");
                      
              fp11.addOption("No");
                      
              fp11.setDefault("Yes");
                  var 
              fp12 = new FunctionParameter("sBidDisplay"FunctionParameter.STRING);
                      
              fp12.setName("Display Bid");
                      
              fp12.addOption("Yes");
                      
              fp12.addOption("No");
                      
              fp12.setDefault("Yes");
                  var 
              fp13 = new FunctionParameter("sTotalDisplay"FunctionParameter.STRING);
                      
              fp13.setName("Display Total");
                      
              fp13.addOption("Yes");
                      
              fp13.addOption("No");
                      
              fp13.setDefault("Yes");

                  var 
              iDebug = new FunctionParameter("iDebug"FunctionParameter.BOOLEAN);
                  
              iDebug.setDefaultfalse );

              }

              var 
              nAsk null;
              var 
              nBid null;
              var 
              nMax 0;
              var 
              aReturn = new Array(4); // return array;

              // Volume
              var nBidVol 0;
              var 
              nInsideVol 0;
              var 
              nAskVol 0;
              var 
              nTotalVol 0;
              var 
              vVol null;
              var 
              bPrimed false;

              // Tick
              var nBidTick 0;
              var 
              nInsideTick 0;
              var 
              nAskTick 0;
              var 
              nTotalTick 0;

              var 
              bEdit true;

              function 
              mainiDebug,  
                  
              sTypesOutputsSourcenFiltercAskcInsidecBid
                      
              nAskThicknessnInsideThicknessnBidThickness,
                      
              sAskDisplaysInsideDisplaysBidDisplaysTotalDisplay) {
                  if (
              getCurrentBarIndex() < 0) return;

                  if (
              bEdit == true) {
                      
              setStudyTitle("TRO_bidaskanalysis " sOutput ": " sSource " (" sType ")");
                      
              setDefaultBarFgColor(cAsk1);
                      
              setDefaultBarFgColor(cInside2);
                      
              setDefaultBarFgColor(cBid3);
                      
              setDefaultBarThickness(nAskThickness1);
                      
              setDefaultBarThickness(nInsideThickness2);
                      
              setDefaultBarThickness(nBidThickness3);
                      
              setDefaultBarThickness(Math.max(nAskThicknessnInsideThicknessnBidThickness), 0);
                      if (
              sOutput == "Raw Data") {
                          
              setCursorLabelName("Ask Total"1);
                          
              setCursorLabelName("Inside Total"2);
                          
              setCursorLabelName("Bid Total"3);
                          
              removeBand("0");
                          
              removeBand("25");
                          
              removeBand("50");
                          
              removeBand("75");
                          
              removeBand("100");
                          
              nMax 0;
                      } else {    
              // Percent
                          
              setCursorLabelName("Ask %"1);
                          
              setCursorLabelName("Inside %"2);
                          
              setCursorLabelName("Bid %"3);
                          
              addBand(0PS_SOLID1Color.black"0");
                          
              addBand(25PS_SOLID1Color.black"25");
                          
              addBand(50PS_SOLID1Color.black"50");
                          
              addBand(75PS_SOLID1Color.black"75");
                          
              addBand(100PS_SOLID1Color.black"100");
                          
              setStudyMax(115);
                      }
                      
              bEdit false;
                  }
                  
                  var 
              nState getBarState();

                  if (
              nState == BARSTATE_NEWBAR && getDay(0) != getDay(-1)) nMax 0;

                  if (
              sSource == "Volume") {
                      if (
              nState == BARSTATE_NEWBAR) {
                          
              vVol 0;
                          if (
              sType == "Bar" || getDay(0) != getDay(-1)) {
                              
              nBidVol 0;
                              
              nInsideVol 0;
                              
              nAskVol 0;
                              
              vVol 0;
                              
              nTotalVol 0;
                              
              aReturn[0] = 0;
                              
              aReturn[1] = 0;
                              
              aReturn[2] = 0;
                              
              aReturn[3] = 0;
                          }
                      }
                      



                      var 
              vPrevVol 0;
                      if (
              vVol != && bPrimed == truevPrevVol vVol;
                      
                      var 
              nTempAsk getMostRecentAsk();
                      var 
              nTempBid getMostRecentBid();
                      if (
              nTempAsk != null && nTempAsk != 0nAsk nTempAsk;
                      if (
              nTempBid != null && nTempBid != 0nBid nTempBid;
                      var 
              vClose close();
                      
              vVol volume();
                      


                      var 
              vTradeVol vVol vPrevVol;

                      var 
              xTradeVol getMostRecentTradeSize();  // TRO

              // DEBUG 

              if(iDebug == true ) {

                
              xSymbol getSymbol().toUpperCase();
               
                
              debugPrint"vTradeVol         : " vTradeVol  "\n" );
                
              debugPrint"xTradeVol         : " xTradeVol  "\n" );  

                
              debugPrint"getCurrentBarCount() : " getCurrentBarCount() +  "\n" );  
                
              debugPrint"Symbol          : " xSymbol  "\n" );

                
              debugPrint"----------------: "  "\n" );

              }


                      if (
              vTradeVol nFilter) return aReturn;
                      

              if( 
              xTradeVol nFilter ) { return ;  }  // TRO 


                      
              if (bPrimed == false && vVol != null) {
                          
              bPrimed true;
                          return;
                      } else {
                          
              nTotalVol += vTradeVol;
                          if (
              vClose <= nBid) {
                              
              nBidVol += vTradeVol;
                          } else if (
              vClose >= nAsk) {
                              
              nAskVol += vTradeVol;
                          } else {
                              
              nInsideVol += vTradeVol;
                          }
                      }
                  } else if (
              sSource == "Tick") {
                      if (
              nState == BARSTATE_NEWBAR) {
                          if (
              sType == "Bar" || getDay(0) != getDay(-1)) {
                              
              nBidTick 0;
                              
              nInsideTick 0;
                              
              nAskTick 0;
                              
              nTotalTick 0;                
                              
              aReturn[0] = 0;
                              
              aReturn[1] = 0;
                              
              aReturn[2] = 0;
                              
              aReturn[3] = 0;
                          }
                      }
                      
                      var 
              nTempAsk getMostRecentAsk();
                      var 
              nTempBid getMostRecentBid();
                      if (
              nTempAsk != null && nTempAsk != 0nAsk nTempAsk;
                      if (
              nTempBid != null && nTempBid != 0nBid nTempBid;
                      var 
              vClose close();
                      
                      
              nTotalTick++;
                      if (
              vClose <= nBid) {
                          
              nBidTick++;
                      } else if (
              vClose >= nAsk) {
                          
              nAskTick++;
                      } else {
                          
              nInsideTick++;
                      }        
                  }
                  
                  
              // Return Data
                  
              var nDtotal;
                  var 
              nDask;
                  var 
              nDinside;
                  var 
              nDbid;
                  if (
              sSource == "Volume") {
                      if (
              sOutput == "Relative Percent") {
                          
              nDtotal 100; if (sTotalDisplay == "No"nDtotal nDtotal+"";
                          
              nDask = (nAskVol/nTotalVol)*100; if (sAskDisplay == "No"nDask nDask.toFixed(4);
                          
              nDinside = (nInsideVol/nTotalVol)*100; if (sInsideDisplay == "No"nDinside nDinside.toFixed(4);
                          
              nDbid = (nBidVol/nTotalVol)*100; if (sBidDisplay == "No"nDbid nDbid.toFixed(4);
                          
              //return new Array(100, (nAskVol/nTotalVol)*100, (nInsideVol/nTotalVol)*100, (nBidVol/nTotalVol)*100);
                      
              } else if (sOutput == "Raw Data") {
                          
              nMax Math.max(nMaxnTotalVol);
                          
              setStudyMax(nMax);
                          
              nDtotal nTotalVol; if (sTotalDisplay == "No"nDtotal nDtotal+"";
                          
              nDask nAskVol; if (sAskDisplay == "No"nDask nDask.toFixed(4);
                          
              nDinside nInsideVol; if (sInsideDisplay == "No"nDinside nDinside.toFixed(4);
                          
              nDbid nBidVol; if (sBidDisplay == "No"nDbid nDbid.toFixed(4);
                          
              //return new Array(nTotalVol, nAskVol, nInsideVol, nBidVol);
                      
              }
                  } else if (
              sSource == "Tick") {
                      if (
              sOutput == "Relative Percent") {
                          
              nDtotal 100; if (sTotalDisplay == "No"nDtotal nDtotal+"";
                          
              nDask = (nAskTick/nTotalTick)*100; if (sAskDisplay == "No"nDask nDask.toFixed(4);
                          
              nDinside = (nInsideTick/nTotalTick)*100; if (sInsideDisplay == "No"nDinside nDinside.toFixed(4);
                          
              nDbid = (nBidTick/nTotalTick)*100; if (sBidDisplay == "No"nDbid nDbid.toFixed(4);
                          
              //return new Array(100, (nAskTick/nTotalTick)*100, (nInsideTick/nTotalTick)*100, 

              (nBidTick/nTotalTick)*100);
                      } else if (
              sOutput == "Raw Data") {
                          
              nMax Math.max(nMaxnTotalTick);
                          
              setStudyMax(nMax);
                          
              nDtotal nTotalTick; if (sTotalDisplay == "No"nDtotal nDtotal+"";
                          
              nDask nAskTick; if (sAskDisplay == "No"nDask nDask.toFixed(4);
                          
              nDinside nInsideTick; if (sInsideDisplay == "No"nDinside nDinside.toFixed(4);
                          
              nDbid nBidTick; if (sBidDisplay == "No"nDbid nDbid.toFixed(4);
                          
              //return new Array(nTotalTick, nAskTick, nInsideTick, nBidTick);
                      
              }
                  }
                  
                  
              aReturn[0] = nDtotal;
                  
              aReturn[1] = nDask;
                  
              aReturn[2] = nDinside;
                  
              aReturn[3] = nDbid;
                  return new Array(
              nDtotalnDasknDinsidenDbid);

              Attached Files

              Comment


              • #8
                Hi Buzz

                When I first opened your post, I thought"no way I am that stupid to not see the vol filter. Then I looked again and mine does not have a volume filter built in. Am I missing something here?
                I truly appreciaet the help and am not a programer, did you put something in the program to get that volume alert?
                It's good to know it works, so if you could let me know how to put that in the edit studies that would be great
                Thanks
                Mark

                Comment


                • #9
                  Just copy/paste the code into notepad.

                  Then save to one of the folders in your FORMULAS folder

                  Then just right click on your chart,

                  click on the formulas folder and

                  click on the folder where you saved it

                  and then click on the file

                  HTH.

                  Comment


                  • #10
                    Hi Buzz

                    Then I copied the program you put in the last thread and got a syntax error and the edit studies still didnt look like the one you posted, so any help here would be great
                    Mark

                    Comment


                    • #11
                      Originally posted by its1111
                      Hi Buzz

                      When I first opened your post, I thought"no way I am that stupid to not see the vol filter. Then I looked again and mine does not have a volume filter built in. Am I missing something here?
                      I truly appreciaet the help and am not a programer, did you put something in the program to get that volume alert?
                      It's good to know it works, so if you could let me know how to put that in the edit studies that would be great
                      Thanks
                      Mark
                      For the record, you are NOT crazy!

                      I must have had a more recent version that had the volume test.

                      I just checked the code from your original post - it's not there!

                      Comment


                      • #12
                        Ok, thanks Buzz, so there must be a new efs with the volume filter built into it like you posted, that helps a ton, I will try to find it, as you are right, mine is a year or so old.
                        thanks agin for the help
                        Mark

                        Comment


                        • #13
                          Originally posted by its1111
                          Ok, thanks Buzz, so there must be a new efs with the volume filter built into it like you posted, that helps a ton, I will try to find it, as you are right, mine is a year or so old.
                          thanks agin for the help
                          Mark
                          EFS attached.
                          Attached Files

                          Comment


                          • #14
                            Hi Buzz

                            Well thank you for the heads up on this new efs, I will give a try in the morning and see how it works, appreciate your time.
                            Mark

                            Comment


                            • #15
                              Buzz

                              Thanks so much for the updated bid/analysis indicator, it worked good but I am going to try to run it on the tick, vol and second charts . I will say it helped me today, so thanks for your help.
                              Mark

                              Comment

                              Working...
                              X