NexusFi: Find Your Edge


Home Menu

 





Float Study in Easy Language code but need help converting to thinkscript


Discussion in ThinkOrSwim

Updated
    1. trending_up 1,772 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 0 attachments




 
Search this Thread

Float Study in Easy Language code but need help converting to thinkscript

  #1 (permalink)
Halcyontrader
Grand Rapids, MI
 
Posts: 1 since Apr 2020
Thanks Given: 0
Thanks Received: 0

Hey Friends,

I have been banging my head against the wall to convert this damn "Easy" Language code and praying that someone would be gracious enough to help in some way.

Here is the raw code as it stands, not overly complicated and is looking at the float of a stock.

It's basically reviewing through the float of the stock and how long it takes for that stock to turnover aka exchange as many shares that are in the float.

please help

Inputs:

FLOATVAL - Is the float value, number of shares currently available for trading
STRTDATE - Is the date at which to start the accummulation of the volume. If STRTDATE is zero, then the accummulation will begin in the LastCalcDate
EXTRGT - determines if the horizontal lines drawn by the indicator will extend to the right, or if they will terminate at the STRTDATE

EasyLanguage Code:
INPUTS: FLOATVAL(365000000), STRTDATE(0), EXTRGT("TRUE");

VARS: VOLCALC(0), BARCOUNT(0), HICALC(0), LOCALC(0), TL1(0), TL2(0), TXT1(0), FAILURE(FALSE);



IF DATE = STRTDATE OR (DATE = LASTCALCDATE AND STRTDATE = 0) THEN BEGIN

BARCOUNT = 0;

FAILURE = FALSE;

PLOT2(HIGH, "STRTDATE");

PLOT3(LOW, "STRTDATE");

WHILE VOLCALC < FLOATVAL AND FAILURE = FALSE BEGIN

IF BARCOUNT > MAXBARSBACK THEN BEGIN

FAILURE = TRUE;

VOLCALC = VOLUME[BARCOUNT+10];

END;

VOLCALC = VOLCALC + VOLUME[BARCOUNT];

BARCOUNT = BARCOUNT + 1;

END;

HICALC = HIGHEST(H, BARCOUNT-1);

LOCALC = LOWEST(L, BARCOUNT-1);



PLOT1[BARCOUNT](HIGH[BARCOUNT]*1.01, "FLOAT");

IF STRTDATE <> 0 THEN BEGIN

TL1 = TL_NEW(STRTDATE, TIME, HICALC, DATE[BARCOUNT], TIME, HICALC);

TL2 = TL_NEW(STRTDATE, TIME, LOCALC, DATE[BARCOUNT], TIME, LOCALC);

END ELSE BEGIN

TL1 = TL_NEW(LASTCALCDATE, TIME, HICALC, DATE[BARCOUNT], TIME, HICALC);

TL2 = TL_NEW(LASTCALCDATE, TIME, LOCALC, DATE[BARCOUNT], TIME, LOCALC);

END;



IF UPPERSTR(EXTRGT) = "TRUE" OR UPPERSTR(EXTRGT) = "T" THEN BEGIN

TL_SETEXTRIGHT(TL1, TRUE);

TL_SETEXTRIGHT(TL2, TRUE);

END;

TL_SETEXTLEFT(TL1, FALSE);

TL_SETEXTLEFT(TL2, FALSE);

END;



IF DATE > STRTDATE AND STRTDATE <> 0 THEN BEGIN

IF LOW CROSSES ABOVE TL_GETENDVAL(TL1) AND CHECKALERT THEN

ALERT = TRUE;

IF HIGH CROSSES BELOW TL_GETENDVAL(TL2) AND CHECKALERT THEN

ALERT = TRUE;

Reply With Quote




Last Updated on April 4, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts