Skip to content

Commit

Permalink
Revert "NOVA-663: test revert fastSearchTimeIndex func changes"
Browse files Browse the repository at this point in the history
  • Loading branch information
stimofeev-tv committed Dec 24, 2024
1 parent 44809ba commit e7acb24
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions links/high_and_low.pine.link
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ fastSearchTimeIndex(x, maxbarsback) =>
mid = 0 * time[maxbarsback]
right = math.min(bar_index, maxbarsback)
left = 0
if time < x
if x/1000 <= first_bar_time
bar_index
else if time < x
0
else
for i = 0 to 9 by 1
for i = 0 to 10
mid := math.ceil((left + right) / 2)
if left == right
break
Expand Down
2 changes: 1 addition & 1 deletion scanner.data.bonds.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"id": "text",
"type": "text",
"defval": "i:#1+1~low@$0*time@$0~s2:ifelif_(#0==0){na():f+$1!na():f}elif(#0==1){low!time/1000}_{#0~#0+1~v:if(!na(low@$7):s_b){$6=$6-1~}~0~v:for(0;$6;1){v:if(low@$10\u003clow@$9){$9=$10~}~}~low@$9!time@$9/1000};i:#1+1~high@$0*time@$0~s2:ifelif_(#0==0){na():f+$1!na():f}elif(#0==1){high!time/1000}_{#0~#0+1~v:if(!na(high@$7):s_b){$6=$6-1~}~0~v:for(0;$6;1){v:if(high@$10\u003ehigh@$9){$9=$10~}~}~high@$9!time@$9/1000};0*time@#1~min(n,#1)~0~if_(time\u003c#0){i:0}_{v:for(0;9;1){$0=ceil(($2+$1)/2)~v:ifelif_($2==$1){break~}elif(time@$0\u003c#0){$1=$0~continue~}elif(time@$0\u003e#0){$2=$0~continue~}_{break~}~}~$0};#0~v:if(n==0){$0=365~}~if_($0==0){na():f}_{sum(((high-low)/abs(low))*100/$0,$0)~if_(#0==0){na():f}_{$3}};if_(#0\u003c0\u0026\u0026close\u003e0){na():f}_{(close-#0)*100/abs(#0)};open@#1*0+#0==0?na():f:$4(open@#0);v^open~year~v:if(year\u003e$1@1){$0=open~}~$4($0);close~$0;$7();v^time/1000~v^high~v^time/1000~v^low~v:if(high\u003e$1){$1=high~$2=time/1000~$3=low~}~v:if(low\u003c$3){$3=low~}~$1~$2~$1~$2~$3~v^low~v^time/1000~v:if(low\u003c$11){$11=low~$12=time/1000~}~$11~$12~$11~$12~v^open~timenow-315532800000~$2($19,i:3652)~timenow-157766400000~$2($21,i:1826)~timenow-94608000000~$2($23,i:1095)~timenow-31449600000~$2($25,i:364)~s2:$0($26,i:364):s2~s2:$1($26,i:364):s2~timenow-15552000000~$2($31,i:180)~s2:$0($32,i:180):s2~s2:$1($32,i:180):s2~timenow-7776000000~$2($37,i:90)~s2:$0($38,i:90):s2~s2:$1($38,i:90):s2~time-2592000000~timenow-2592000000~$2($44,i:30)~$2($43,i:30)~s2:$0($45,i:30):s2~s2:$1($45,i:30):s2~timenow-604800000~time-604800000~$2($51,i:7)~$2($52,i:7)~s2:$0($53,i:7):s2~s2:$1($53,i:7):s2~$3($54)~$3($46)~tr(b:true)*100/abs(low)~timenow-31536000000~$2($62,i:365)~$6()~((close-open@4)/open@4)*100~$5($53,i:7)~$5($45,i:30)~$5($38,i:90)~$5($32,i:180)~$5($63,i:365)~$5($24,i:1095)~$5($22,i:1826)~$5($20,i:3652)~time_tradingday/1000~#0~$75~$76-$76@1~na():f~v:if(!($76@1\u003c0)\u0026\u0026!($76\u003c0)){$78=($77/$76@1)*100~}~$78~timenow-86400000~$2($81,i:1)~v:max_bars_back(close,365):v~close@$82~close@$45~close@$63~$0!$6!$7!$8!$9!$10!$14!$15!$16!$17!$18!$27!$28!$29!$30!$33!$34!$35!$36!$39!$40!$41!$42!$47!$48!$49!$50!$55!$57!$59!$60!$61!$65!$66!$67!$68!$69!$70!$71!$72!$73!$64!$74!$76!$77!$80!$84!$85!$86;t:str.substring(ticker,0,str.length(ticker):i-1):t~t:sc(t:syminfo.prefix,t:':',t:$10):t~i:na():f~sym($11,period,period,false,false,true,'NONE',false,false,$12)|$8()|s49:$9($14):s49~$16!$17!$18!$19!$20!$21!$22!$23!$24!$25!$26!$27!$28!$29!$30!$31!$32!$33!$34!$35!$36!$37!$38!$39!$40!$41!$42!$43!$44!$45!$46!$47!$48!$49!$50!$51!$52!$53!$54!$55!$56!$57!$58!$59!$60!$61!$62!$63!$64",
"defval": "i:#1+1~low@$0*time@$0~s2:ifelif_(#0==0){na():f+$1!na():f}elif(#0==1){low!time/1000}_{#0~#0+1~v:if(!na(low@$7):s_b){$6=$6-1~}~0~v:for(0;$6;1){v:if(low@$10\u003clow@$9){$9=$10~}~}~low@$9!time@$9/1000};i:#1+1~high@$0*time@$0~s2:ifelif_(#0==0){na():f+$1!na():f}elif(#0==1){high!time/1000}_{#0~#0+1~v:if(!na(high@$7):s_b){$6=$6-1~}~0~v:for(0;$6;1){v:if(high@$10\u003ehigh@$9){$9=$10~}~}~high@$9!time@$9/1000};0*time@#1~min(n,#1)~0~ifelif_(#0/1000\u003c=#2){n}elif(time\u003c#0){i:0}_{v:for(0;10;1){$0=ceil(($2+$1)/2)~v:ifelif_($2==$1){break~}elif(time@$0\u003c#0){$1=$0~continue~}elif(time@$0\u003e#0){$2=$0~continue~}_{break~}~}~$0};#0~v:if(n==0){$0=365~}~if_($0==0){na():f}_{sum(((high-low)/abs(low))*100/$0,$0)~if_(#0==0){na():f}_{$3}};if_(#0\u003c0\u0026\u0026close\u003e0){na():f}_{(close-#0)*100/abs(#0)};open@#1*0+#0==0?na():f:$4(open@#0);v^open~year~v:if(year\u003e$1@1){$0=open~}~$4($0);close~$0;$7();v^time/1000~v^high~v^time/1000~v^low~v:if(high\u003e$1){$1=high~$2=time/1000~$3=low~}~v:if(low\u003c$3){$3=low~}~$1~$2~$1~$2~$3~v^low~v^time/1000~v:if(low\u003c$11){$11=low~$12=time/1000~}~$11~$12~$11~$12~v^open~timenow-315532800000~$2($19,i:3652,$0)~timenow-157766400000~$2($21,i:1826,$0)~timenow-94608000000~$2($23,i:1095,$0)~timenow-31449600000~$2($25,i:364,$0)~s2:$0($26,i:364):s2~s2:$1($26,i:364):s2~timenow-15552000000~$2($31,i:180,$0)~s2:$0($32,i:180):s2~s2:$1($32,i:180):s2~timenow-7776000000~$2($37,i:90,$0)~s2:$0($38,i:90):s2~s2:$1($38,i:90):s2~time-2592000000~timenow-2592000000~$2($44,i:30,$0)~$2($43,i:30,$0)~s2:$0($45,i:30):s2~s2:$1($45,i:30):s2~timenow-604800000~time-604800000~$2($51,i:7,$0)~$2($52,i:7,$0)~s2:$0($53,i:7):s2~s2:$1($53,i:7):s2~$3($54)~$3($46)~tr(b:true)*100/abs(low)~timenow-31536000000~$2($62,i:365,$0)~$6()~((close-open@4)/open@4)*100~$5($53,i:7)~$5($45,i:30)~$5($38,i:90)~$5($32,i:180)~$5($63,i:365)~$5($24,i:1095)~$5($22,i:1826)~$5($20,i:3652)~time_tradingday/1000~#0~$75~$76-$76@1~na():f~v:if(!($76@1\u003c0)\u0026\u0026!($76\u003c0)){$78=($77/$76@1)*100~}~$78~timenow-86400000~$2($81,i:1,$0)~v:max_bars_back(close,365):v~close@$82~close@$45~close@$63~$0!$6!$7!$8!$9!$10!$14!$15!$16!$17!$18!$27!$28!$29!$30!$33!$34!$35!$36!$39!$40!$41!$42!$47!$48!$49!$50!$55!$57!$59!$60!$61!$65!$66!$67!$68!$69!$70!$71!$72!$73!$64!$74!$76!$77!$80!$84!$85!$86;t:str.substring(ticker,0,str.length(ticker):i-1):t~t:sc(t:syminfo.prefix,t:':',t:$10):t~i:na():f~sym($11,period,period,false,false,true,'NONE',false,false,$12)|$8()|s49:$9($14):s49~$16!$17!$18!$19!$20!$21!$22!$23!$24!$25!$26!$27!$28!$29!$30!$31!$32!$33!$34!$35!$36!$37!$38!$39!$40!$41!$42!$43!$44!$45!$46!$47!$48!$49!$50!$51!$52!$53!$54!$55!$56!$57!$58!$59!$60!$61!$62!$63!$64",
"isFake": false
},
{
Expand Down
Loading

0 comments on commit e7acb24

Please sign in to comment.