tarzan

Intramarket Correlator L-O-L-A excerpt

Here we have an intramarket correlator taken as an excerpt from the L-O-L-A institutional trading system.

The plot displayed on the screen is the correlation index of the correlated security plotted against the security data series. Suggest simple line plots of contrasting colors.

When the plot is below the security price this is an indication of a strong negative correlation. When the plot is above the security price this is indicative of a strong positive correlation.

Provided for free by Tarzan at tradingview. or noprism@hushmail.com

plz contact for more information on L-O-L-A

*** Past performance is not necessarily indicative of future results ***

Life is like a moving picture

Nothing in life is a permanent fixture

Ray Davies
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?
//@version=2
study("Intramarket Correlator", title= "L-O-L-A exerpt Lola Multi v 6.08", overlay=true)
//
//  Life is only a moving picture
//
//  Nothing in life is a permanent fixture
//
//  We lve
//
//  We die
//
//  No one
//
//  Knows why
//
//
// here we have an exerpt from the master trading system LOLA which is available for institutional trading 

// plz contact tarzan at tradingview or noprism@hushmail.com for details
//
//         ** Past performance is not necessarily indicative of future results donkey **
//


c = navy

bgColor = (dayofweek == monday)    ? color(c, 98) :
          (dayofweek == tuesday)   ? color(c, 96) :
          (dayofweek == wednesday) ? color(c, 94) :
          (dayofweek == thursday)  ? color(c, 92) :
          (dayofweek == friday)    ? color(c, 90) : na
          
          
bgcolor(color = bgColor)

// Well I'm not the world's most physical guy but when she squeezed me tight she nearly broke my spine
//
//                            Oh my lola lo-lo-lo-lo lola


correlat = input(title = "Correlation Index", defval=1, minval=0, maxval=1, step=1)
secname = input("DX1!", title = "Security to correlate", type=string )
jimmyskew = input(title = "Jimmy Skew", defval=0, step=1, minval=0)
enter_fast = input(title = "length of correlation array[strict=20]", defval=9, minval=1)
offsetamt = input(title = "plot offset", defval=0, minval=0)
primarytrendmult = input(title = "longer term trend length adder", defval=-6, step=1)
usingprice=input(title = "price basis 0=open 1=high 2=low 3=close", defval=3, minval=0, maxval=3, step=1)
startyear =input(title = "Start year", defval=2000, step=1)
endyear =input(title = "Stop year", defval=2017, step=1)
startmonth = input(title = "Start month", defval=1, step=1)
endmonth  = input(title = "Stop month ", defval=12, step=1)

pricetouse = (usingprice == 0) ? open  : 
             (usingprice == 1) ? high  : 
             (usingprice == 2) ? low   : 
             (usingprice == 3) ? close : na 


//some globals but then again everything is global here so be careful donkeys

// pressure pressure I got pressure oh yeah oh yeah

USDX = tickerid("ICEUSA",secname)
s = security(secname, "D", pricetouse) 

currentbarnumber = n

// dk biology 

jimmy = correlation(s[jimmyskew],pricetouse[jimmyskew],(enter_fast + primarytrendmult + jimmyskew))  

differential=(pricetouse < 10 ) ? jimmy*.1 :
             (pricetouse >= 10 and pricetouse < 100) ? jimmy :
             (pricetouse >= 100 and pricetouse < 1000) ? jimmy*10 :
             (pricetouse >=1000 and pricetouse < 10000) ?jimmy*100 : jimmy*1000

plot((pricetouse+differential), color=red,style=line, offset=offsetamt, linewidth=2)


plot(close)