Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

mrtraderguy

Members
  • Content Count

    15
  • Joined

  • Last visited

Personal Information

  • First Name
    TradersLaboratory.com
  • Last Name
    User
  • City
    Miami
  • Country
    United States
  • Gender
    Male

Trading Information

  • Vendor
    No
  1. I have found the solution, it's a black box thing, as I suspected. There is NO NEED to count bars, apparently, the logic in the Indicator runs on every bar, automatically, so the indicator, when it loads or fires (at the end of a bar formation) parses all the bars back automatically. For example, the following code, all by itself, will print out for each bar, the volume: [color="Blue"]Print[/color]("[color="DarkGreen"]Current bar:[/color] ", [color="Blue"]CurrentBar[/color], " [color="DarkGreen"]has volume of [/color]", [color="Blue"]Volume[CurrentBar][/color]); So, stupid thing I guess, on me ... I was not knowledgable regarding the system parser interworkings (the black box)! So the code is very easy then: [HIGHLIGHT GREEN][i]// It is not programatically possible to reliably retrieve // float yet, so it must be input per symbol[/i][/HIGHLIGHT GREEN] [color="Blue"]Inputs: [/color] TotalCurrentFloat(0); [HIGHLIGHT GREEN]// Full number of shares, i.e. 93460000 for 93.46M[/HIGHLIGHT GREEN] [color="blue"]Variables: [/color] intVolumeCounter(1),[HIGHLIGHT GREEN][i]// Holds cummulative volume until is equal to or above float[/i][/HIGHLIGHT GREEN] intBarsBackCounter(0);[HIGHLIGHT GREEN]// Holds final bar number (back from current) where float turned[/HIGHLIGHT GREEN] [HIGHLIGHT GREEN]// If left in a chart, and the symbol has no TotalCurrentFloat value, this will pass through[/HIGHLIGHT GREEN] [color="Blue"]If [/color]intVolumeCounter < TotalCurrentFloat [color="blue"]Then Begin[/color] [indent]intVolumeCounter = intVolumeCounter + [color="blue"]Volume[CurrentBar][/color];[/indent] [indent]intBarsBackCounter = [color="blue"]CurrentBar[/color];[/indent] [color="Blue"]End;[/color] [color="blue"]If[/color] TotalCurrentFloat > 0 [color="blue"]And CurrentBar[/color] <= (intBarsBackCounter+1) [color="blue"]Then Print[/color]("[color="DarkGreen"]Float turned in [/color]", intBarsBackCounter, " [color="darkgreen"]bars[/color]"); This adds volume for each bar until it reaches the variable/input TotalCurrentFloat and when it falls through the if/then and leaves intBarsBackCounter with a number indicating the bar at which the float was turned from the current date, bars back. Works perfect on every one so far :-) So, now onto the good stuff :-) Thanks TAMS and all! I know there's probably code out there that already does this, but it's nice to understand what's going on to be sure it's accurate! Anyway, I'll post it later, just for good laugh! Ah, it's Miller time!! MTG DISCLAIMER: I retyped this from memory, not copy/paste, so code typos are possible :-)
  2. No worries, I agree BFish, that's why I just provide options and take nothing personally :-) I've coded in other areas for years, and yet find myself in a new category every day! The only thing we know for sure is that we don't know everything! Always happy to help where I can and learn everything along the way :-) OK, I'm back to work!
  3. I agree with you both, (BFish/Tams) ... it could be just a quick fix need, but I don't really like to try to do quick-fix as it always seems to effect other things and make other problems. Start simple, test, expand, test, etc. is my motto :-) Anyway, since I have a similar indicator, just offering to share/help as best I can; not necessarily fix anything existing ... just giving back what I can as I get help from time-to-time as well. I'm not claiming anyone, myself included, right or wrong; just providing options :-)
  4. A) OK, so the setup (assuming TS 8.6) is a symbol with at least three data series: [1]Symbol, [2] Slow Stochs, [3] Fast Stochs. --> Note: I do expect the data series to be in the right place; I don't error check on this since I write stuff for myself and keep all my setups correct by hand :-) B) So you're looking for divergence between data series [2] & [3] then, from what I read above. C) The main condition is that both lines in [2] are flat or down and both lines in [3] are up. D) Crossing of the lines is not relevant here; just [2] both flat/down and [3] up at the same time. E) The processing of the conditions does not occur intra-bar, only on closed bars. Is this correct? I'm rebuilding some code now that was lost during a BlueScreen this morning, so since most of this is the same as what I have, I'll post what I have later and you can use it if you want or can change it to whatever you need. MTG
  5. Tradestation is KILLING me. Apparently, it does not save files that are verified. The hundred or so lines I had written vaporized after a bluescreen on Vista. I had them veririfed, and inserted to a radar screen and when TS restarted, it deleted the file for some reason. Excellent. OK, back to the drawing board here then ... I'll try the setting changed you mentioned once I get it all back from memory :-) Thx Tams.
  6. Why would you advocate having ANY taxes is the question!!!
  7. I have been looking and can't find anything; this is REALLY pissin me off! If you have anywhere to look, let me know, it's makin me crazy, otherwise, I'm going to have to do it in excel and just transfer all the numbers every day and recalculate ... and I pay alot of money for that stupid tradestation crap too!
  8. I want to be able to scan, so switching charts would be time consuming. Want to be able to track a few hundred stocks with this. Chart is great for individual lookups, but when scanning, it's tough :-) What I want to see is that the closing price, as the float has turned over, is increasing and that the weighted average price based on volume was at least 10% below the latest close. So, ultimately, if the stock has had a lower price over the history of the float turning over, than it does now, AND, it starts moving up on volume, then it is reasonable to assume that the holders of the stock in this current "batch" of holders (that batch being this floats holders of the stock) are into a profit and should hold until a certain return level above the average volume/price level during the float turn over period. When the float turns over, and say, it turned after being at $20 for 80 of the last 90 bars of the current float turnover, and in the last 10 bars, it moved up $1, it is reasonable to assume that supply might dry up as those holding are in at an average price of $20 and will look for at least a 10-20% return before selling. Assumptive of course, but the logic to start testing all of this can't even BEGIN because the DAMN LOOP WILL NOT WORK!!! :-)
  9. OK, I added another print statement to test output, looks like loops need to be PRIMED or something in TradeStation? I changed the float INPUT to 5.5M so the output here would not be so lengthy, showing it all just for completeness. As you can see, the loop does NOT allow the pointer to increment on the first loop, so it reads the same volume (519831.00) for each bar on the FIRST loop. Then when it gets going, it reads the proper values. SO ... how do you PRIME a LOOP in TS so it will work properlty?! That is the BLACK BOX stuff I do not expect as they are not adherent to standards of probramming! Here's the output on this one: -- Found FRO, entering loop -- FRO at bar 0.00 volume was 519831.00 FRO at bar 0.00 total so far 519831.00 FRO at bar 1.00 volume was 519831.00 FRO at bar 1.00 total so far 1039662.00 FRO at bar 2.00 volume was 519831.00 FRO at bar 2.00 total so far 1559493.00 FRO at bar 3.00 volume was 519831.00 FRO at bar 3.00 total so far 2079324.00 FRO at bar 4.00 volume was 519831.00 FRO at bar 4.00 total so far 2599155.00 FRO at bar 5.00 volume was 519831.00 FRO at bar 5.00 total so far 3118986.00 FRO at bar 6.00 volume was 519831.00 FRO at bar 6.00 total so far 3638817.00 FRO at bar 7.00 volume was 519831.00 FRO at bar 7.00 total so far 4158648.00 FRO at bar 8.00 volume was 519831.00 FRO at bar 8.00 total so far 4678479.00 FRO at bar 9.00 volume was 519831.00 FRO at bar 9.00 total so far 5198310.00 FRO at bar 10.00 volume was 519831.00 FRO at bar 10.00 total so far 5718141.00 FRO done processing and counted 11.00 bars -- Found FRO, entering loop -- FRO at bar 0.00 volume was 519831.00 FRO at bar 0.00 total so far 519831.00 FRO at bar 1.00 volume was 706501.00 FRO at bar 1.00 total so far 1226332.00 FRO at bar 2.00 volume was 753182.00 FRO at bar 2.00 total so far 1979514.00 FRO at bar 3.00 volume was 622070.00 FRO at bar 3.00 total so far 2601584.00 FRO at bar 4.00 volume was 803162.00 FRO at bar 4.00 total so far 3404746.00 FRO at bar 5.00 volume was 1977310.00 FRO at bar 5.00 total so far 5382056.00 FRO at bar 6.00 volume was 843000.00 FRO at bar 6.00 total so far 6225056.00 FRO done processing and counted 7.00 bars
  10. TradeStation 8.6 Version: 8.6 (Build 2696) Date: 10/12/2009
  11. OK, I modified the code as follows so anyone can test: inputs: MyTotalFloat( 0 ); variables: intVolumeCounter( 0 ), x( 0 ); If myTotalFloat > 0 Then Begin If GetSymbolName = "FRO" Then Begin While intVolumeCounter < myTotalFloat Begin intVolumeCounter = intVolumeCounter + Volume[x]; x = x + 1; Print(GetSymbolName, " has volume total of ", intVolumeCounter, " at bar ", x); End; End; End; For the INPUT value in the RadarScreen, I have 11500000 (11.5M) for myTotalFloat. AND IT STILL RUNS TWO TIMES!! Here is the PrintLog Result: FRO has volume total of 519831.00 at bar 1.00 FRO has volume total of 1039662.00 at bar 2.00 FRO has volume total of 1559493.00 at bar 3.00 FRO has volume total of 2079324.00 at bar 4.00 FRO has volume total of 2599155.00 at bar 5.00 FRO has volume total of 3118986.00 at bar 6.00 FRO has volume total of 3638817.00 at bar 7.00 FRO has volume total of 4158648.00 at bar 8.00 FRO has volume total of 4678479.00 at bar 9.00 FRO has volume total of 5198310.00 at bar 10.00 FRO has volume total of 5718141.00 at bar 11.00 FRO has volume total of 6237972.00 at bar 12.00 FRO has volume total of 6757803.00 at bar 13.00 FRO has volume total of 7277634.00 at bar 14.00 FRO has volume total of 7797465.00 at bar 15.00 FRO has volume total of 8317296.00 at bar 16.00 FRO has volume total of 8837127.00 at bar 17.00 FRO has volume total of 9356958.00 at bar 18.00 FRO has volume total of 9876789.00 at bar 19.00 FRO has volume total of 10396620.00 at bar 20.00 FRO has volume total of 10916451.00 at bar 21.00 FRO has volume total of 11436282.00 at bar 22.00 FRO has volume total of 11956113.00 at bar 23.00 FRO had 23.00 bars counted FRO has volume total of 519831.00 at bar 1.00 FRO has volume total of 1226332.00 at bar 2.00 FRO has volume total of 1979514.00 at bar 3.00 FRO has volume total of 2601584.00 at bar 4.00 FRO has volume total of 3404746.00 at bar 5.00 FRO has volume total of 5382056.00 at bar 6.00 FRO has volume total of 6225056.00 at bar 7.00 FRO has volume total of 8147119.00 at bar 8.00 FRO has volume total of 9546118.00 at bar 9.00 FRO has volume total of 11463405.00 at bar 10.00 FRO has volume total of 12276220.00 at bar 11.00 FRO had 11.00 bars counted Madness I tell you!!
  12. GREAT IDEA ... so yes I did manually calculate the data, for example, for FRO (a stock I trade all the time) I put 1500000 (1.5 M) in for the FLOAT value (input value above as myTotalFloat). Then, the PrintLog window shows this: FRO had 3.00 bars counted FRO had 3.00 bars counted Which is CORRECT, since in three days, it will do 1.5M shares. BUT ... I don't want it running TWO times! Look at the code, there is NO REASON for this to run and print TWO outputs!! When the numbers get larger, the calculations get repeated more. This is the most simple thing I can imagine, and yet, there is something in the way EasyLanguage PROCESSES loops that is unknown to me. So, for the same symbol, FRO, I put in 11500000 (11.5M) this time and I get: FRO had 23.00 bars counted FRO had 11.00 bars counted Here, however, 11 bars is the correct answer! I expect a single calculation for each stock in the RadarScreen window. Not multiple random loops run with various different answers. I thought it was simple, but something is eluding me in the black box of EL. IF the volume I have counted so far is less than the total float THEN Add the volume from the day before and test again OR Keep adding the volume from each day backwards from today until you total a value that is equal to or greater than the float INPUT value What is going on that I do not know here?!?! THX so much, I am about to throw my computer into the canal!!
  13. Does this mean you want a slope calculation on the plots? So you want to know when some point A followed by point B is negative in slope and then point C is positive in slope for two separate averages? As an example data set: ------------ Avg1 -------- Avg2 Time1 -- 12 ---------- 10 Time2 -- 10 ---------- 9 Time3 -- 11 ---------- 10 In the above, each average moves down from Time1 to Time2 then up from Time2 to Time3 but they do not cross in this example data set here. I do this with crossing action, but not for slope change ... so curious exactly what you're asking, just to be clear :-)
  14. If you just get 1% of the nations income every year via some new tax, you'll have ALL of their income within a generation! STOP ALL TAXES NOW!!
  15. INSANITY! This loop runs multiple times giving me faulty data, what is going on! inputs: myTotalFloat( 0 ); variables: intVolumeCounter( 0 ), x( 0 ); If myTotalFloat > 0 Then Begin // While intVolumeCounter < myTotalFloat Begin intVolumeCounter = intVolumeCounter + Volume[x]; x = x + 1; // End; Print(GetSymbolName, " had ", x, " bars counted"); End; SO ... if I leave the above, as is, I get ONE print in the Print Log for EACH symbol in a radar screen window, just ONCE. If I take the comment lines OUT on the WHILE loop in the above, and let it run, I get two or three PRINT statements for each symbol. WTF!! Here is the output with the LOOP commented OUT LVLT had 1.00 bars counted FCEL had 1.00 bars counted JCG had 1.00 bars counted BDCO had 1.00 bars counted Here is the output with the LOOP NOT commented OUT LVLT had 159.00 bars counted LVLT had 118.00 bars counted FCEL had 263.00 bars counted JCG had 8.00 bars counted JCG had 14.00 bars counted JCG had 18.00 bars counted JCG had 21.00 bars counted JCG had 24.00 bars counted BDCO had 1533.00 bars counted Here's what I want, if it helps (skip section if not important) I want to INPUT the float for a stock. Then, I want to start at the current bar, and compare the DAILY volume with the float. If total volume is less than the float, go back one day and add that volume, test again, and so on. At some point, we go back far enough to see if the total float has been traded. I want to identify that bar, as in 5 days back or 300 days back, etc. I have found that when the total float is turned over, the price activity is different depending on how long it took to turn over and the prices during the turn over. So the length of time it takes to trade the entire float is important to me. There is some secret thing in EasyLanguage I do not know... I have programmed for 20 years and NEVER have I seen a loop repeat unless it is told or looped within another loop. There is NO REASON a loop, once it's done, should run again as the assembly code for this creates a break when the loop condition is fulfilled. I want a SINGLE check back on each stock, then move on to the next stock. TradeStation EasyLanguage seems to have some secret, hidden thing somewhere that makes loops run a few times that I do not know about. What I have tried... I am using the indicator on DAILY chart or RadarScreen with nothing fancy at all. I have stripped it down to its most simple aspects and still, mulitiple runs with multiple outputs for multiple stocks ... crazy! I tried a FOR loop, a WHILE loop and even did a few IF/THEN statements and I can not get it to just check back on a single stock, ONE time, and move on to the next symbol! I tried initializing variables, I tried putting all the loop values into INPUT values, it did not matter. As soon as the LOOP aspect was introduced to the indicator, it starts spitting out multiple runs. Help is appreciated beyond imagination! Thanks.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.