StockFetcher Forums · Filter Exchange · I need a fresh set of eyes to look over this code. << >>Post Follow-up
586 posts
msg #133318
modified
12/20/2016 12:06:19 PM

I am getting different numbers on the long side and the short side. Should not they both be
the same as the quantities are the same on both sides. Why are the dollar amounts different?
I have looked at this over and over again to no avail. Each Bollinger quadrant is the same
size. What am I missing?

EDIT: I have figured it out. I was looking for an error in the code, I guess first place to look right?
It was as obvious as the nose on my face. When you short you short at a higher price than
when you go long, so the number change was staring me in the face all along.

Fetcher[
/************************************************************************/
set{lb1, lower Bollinger Band(20,1)}
set{ubb2, Upper Bollinger Band(20,2)}

set{u2, Upper Bollinger Band(20,2) - Upper Bollinger Band(20,1)}
set{mm, Upper Bollinger Band(20,1) - Lower Bollinger Band(20,1)}

set{long1, count(Price crossed above the bottom Bollinger Band(20,2),1)}
set{short1, count(Price crossed below the Upper Bollinger Band(20,2),1)}

/********************************************************************/
/******************LONG MONEY CALCULATION****************************/
/********************************************************************/

set{x, Lower Bollinger Band(20,1) - Lower Bollinger Band(20,2)}
set{x2, 80. / x}
set{Lrisk, x2 * x}
set{Lcashin, lower Bollinger Band(20,1) * x2}
set{lreward1, Upper Bollinger Band(20,1) / Lower Bollinger Band(20,1)}
set{lreward%, long1 * lreward1}
set{lreward2, lreward1 * Lcashin}
set{lreward, lreward2 - LCashin}

/********************************************************************/
/*****************SHORT MONEY CALCULATION****************************/
/********************************************************************/

set{Y, UPPER Bollinger Band(20,2) - UPPER Bollinger Band(20,1)}
set{Y2, 80. / Y}
set{Srisk, Y2 * Y}
set{scashin, upper Bollinger Band(20,1) * y2}
set{sreward1, Upper Bollinger Band(20,1) / Lower Bollinger Band(20,1)}
set{sreward%, short1 * sreward1}
set{sreward2, sreward1 * scashin}
set{sreward, sreward2 - scashin}

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

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

close above 5
average volume(30) above 500000
draw ema(8)
draw Upper Bollinger Band(20,2)
draw Lower Bollinger Band(20,1)
draw median bollinger line(20,2)

]

Mactheriverrat
2,760 posts
msg #133336
Ignore Mactheriverrat
12/20/2016 11:11:20 PM

AKS for another leg up!

pthomas215
1,251 posts
msg #133337
Ignore pthomas215
12/20/2016 11:31:09 PM

Thanks Mac. I got about 40 cents on it today. I wouldnt have known about it if it wasnt for you. Got out too early--do you think its going to 11.70 or so?

Mactheriverrat
2,760 posts
msg #133341
Ignore Mactheriverrat
12/21/2016 12:49:28 AM

Next resistance is around the \$17.50 area.

 TITrader6 postsmsg #157500- Ignore TITrader 9/4/2021 10:13:14 PMHey SAFeTRADE. This scan seems great. How is it possible which tickers were added current/prior day? It seems like I can only filter everything using the columns. Thanks
 StockFetcher Forums · Filter Exchange · I need a fresh set of eyes to look over this code. << >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.