Harigami
ログイン
anonymous タイトルなし
Python
//@version=4
study("MTF Donchian Fibonacci", shorttitle="DCF MTF", overlay=true)
//数値
len = input(defval="60", type=input.resolution, title="時間軸")
res = input(defval=false, title="チェック=MTF表示")
len3 = input(defval=37, minval=1, title="期間")
res2 = res ? len : timeframe.period
h = security(syminfo.tickerid, res2, highest(high, len3))
l = security(syminfo.tickerid, res2, lowest(low, len3))
basis = avg(h, l)
len2 = h - l
h2 = h - len2 * 0.236
h1 = h - len2 * 0.382
l1 = h - len2 * 0.618
l2 = h - len2 * 0.786
//カラー
fill(plot(h, title="±3σ"), plot(l), color=color.aqua)
fill(plot(h2, title="±2σ"), plot(l2), color=color.aqua)
fill(plot(h1), plot(l1), title="±1σ", color=color.aqua)
plot(basis, color=color.orange, style=plot.style_cross)
plot(basis, color=color.orange, style=plot.style_cross)

// cross 3σ alert
cross_h = high==h
cross_l = low==l

plotshape(cross_h, "crossover +3σ", shape.arrowdown, location.abovebar, color.red, size=size.normal)
plotshape(cross_l, "crossunder -3σ", shape.arrowup, location.belowbar, color.green, size=size.normal)

alertcondition(cross_h or cross_l, "cross ±3")
  • 0
  • 1
anonymous タイトルなし
Python
//@version=4
study("MTF Donchian Fibonacci", shorttitle="DCF MTF", overlay=true)
//数値
len = input(defval="60", type=input.resolution, title="時間軸")
res = input(defval=false, title="チェック=MTF表示")
len3 = input(defval=37, minval=1, title="期間")
res2 = res ? len : timeframe.period
h = security(syminfo.tickerid, res2, highest(high, len3))
l = security(syminfo.tickerid, res2, lowest(low, len3))
basis = avg(h, l)
len2 = h - l
h2 = h - len2 * 0.236
h1 = h - len2 * 0.382
l1 = h - len2 * 0.618
l2 = h - len2 * 0.786

//カラー
fill(plot(h, title="±3σ"), plot(l), color=color.aqua)
fill(plot(h2, title="±2σ"), plot(l2), color=color.aqua)
fill(plot(h1), plot(l1), title="±1σ", color=color.aqua)
plot(basis, color=color.orange, style=plot.style_cross)
plot(basis, color=color.orange, style=plot.style_cross)

// cross 3σ alert
cross_h = high==h
cross_l = low==l

plotshape(cross_h, "crossover +3σ", title="sell", style=shape.triangledown, text="sell", color=color.red, textcolor=color.red, location=location.abovebar)
plotshape(cross_l, "crossunder -3σ", title="buy", style=shape.triangleup, text="buy", color=color.blue, textcolor=color.blue, location=location.belowbar)

alertcondition(title="sell", message="sell" cross_h, "cross +3σ")
alertcondition(title="buy", message="buy" cross_l, "cross -3σ")
  • 0
  • 0
anonymous タイトルなし
Python
We are most delighted in partnering with you, and we intend to maintain a Silent/Financial Position 
on our Business with your Company as we look forward to a prospective business relationship. 
I am Mrs. Suhayba Ammar, wife of Sadiq Al-Bashir the Sudanese president's brother from Sudan to Turkey 
on asylum and now in Belgium. I have important business to discuss with you. Looking forward to hearing 
from you soon sadiq.al-bashir@mail.com 
Regards, 
Mrs. Suhayba Ammar.
  • 0
  • 0
LC23 タイトルなし
Python
//@version=4
study("自動平行チャネル", "短期中期", true, format.inherit)
period     = input(     300, "中期チャネル期間"       , input.integer, minval=3)
period2     = input(     100, "短期チャネル期間"       , input.integer, minval=3)
deviations = input(    2.0, "中期チャネル幅調整" , input.float  , minval=0.1, step=0.1)
deviations2 = input(    2.0, "短期チャネル幅調整" , input.float  , minval=0.1, step=0.1)
extendType = input("ON", "中期チャネル延長", input.string , options=["ON","OFF"])=="ON" ? extend.right : extend.none
extendType2 = input("ON", "短期チャネル延長", input.string , options=["ON","OFF"])=="ON" ? extend.right : extend.none
periodMinusOne = period-1
periodMinusOne2 = period2-1
///中期
Ex = 0.0, Ey = 0.0, Ex2 = 0.0, Exy = 0.0, for i=0 to periodMinusOne
    closeI = nz(close[i]), Ex := Ex + i, Ey := Ey + closeI, Ex2 := Ex2 + (i * i), Exy := Exy + (closeI * i)
ExEx = Ex * Ex, slope = Ex2==ExEx ? 0.0 : (period * Exy - Ex * Ey) / (period * Ex2 - ExEx)
linearRegression = (Ey - slope * Ex) / period
intercept = linearRegression + bar_index * slope
deviation = 0.0, for i=0 to periodMinusOne
    deviation := deviation + pow(nz(close[i]) - (intercept - slope * (bar_index[i])), 2.0)
deviation := deviations * sqrt(deviation / periodMinusOne)
startingPointY = linearRegression + slope * periodMinusOne
var line upperChannelLine = na  , var line medianChannelLine = na  , var line lowerChannelLine = na
line.delete(upperChannelLine[1]), line.delete(medianChannelLine[1]), line.delete(lowerChannelLine[1])
///短期
Ex3 = 0.0, Ey3 = 0.0, Ex4 = 0.0, Exy3 = 0.0, for i3=0 to periodMinusOne2
    closeI3 = nz(close[i3]), Ex3 := Ex3 + i3, Ey3 := Ey3 + closeI3, Ex4 := Ex4 + (i3 * i3), Exy3 := Exy3 + (closeI3 * i3)
ExEx3 = Ex3 * Ex3, slope3 = Ex4==ExEx3 ? 0.0 : (period2 * Exy3 - Ex3 * Ey3) / (period2 * Ex4 - ExEx3)
linearRegression3 = (Ey3 - slope3 * Ex3) / period2
intercept3 = linearRegression3 + bar_index * slope3
deviation3 = 0.0, for i3=0 to periodMinusOne2
    deviation3 := deviation3 + pow(nz(close[i3]) - (intercept3 - slope3 * (bar_index[i3])), 2.0)
deviation3 := deviations2 * sqrt(deviation3 / periodMinusOne2)
startingPointY3 = linearRegression3 + slope3 * periodMinusOne2
var line upperChannelLine3 = na  , var line medianChannelLine3 = na  , var line lowerChannelLine3 = na
line.delete(upperChannelLine3[1]), line.delete(medianChannelLine3[1]), line.delete(lowerChannelLine3[1])
///カラー
upperChannelLine  := line.new(bar_index - period + 1, startingPointY + deviation, bar_index, linearRegression + deviation, xloc.bar_index, extendType, color.lime, line.style_solid , 2)
medianChannelLine := line.new(bar_index - period + 1, startingPointY            , bar_index, linearRegression            , xloc.bar_index, extendType, color.lime, line.style_solid , 1)
lowerChannelLine  := line.new(bar_index - period + 1, startingPointY - deviation, bar_index, linearRegression - deviation, xloc.bar_index, extendType, color.lime, line.style_solid , 2)

upperChannelLine3  := line.new(bar_index - period2 + 1, startingPointY3 + deviation3, bar_index, linearRegression3 + deviation3, xloc.bar_index, extendType2, color.red, line.style_solid , 2)
lowerChannelLine3  := line.new(bar_index - period2 + 1, startingPointY3 - deviation3, bar_index, linearRegression3 - deviation3, xloc.bar_index, extendType2, color.red, line.style_solid , 2)
  • 0
  • 0
anonymous タイトルなし
Python
Mamamamammamamammam
  • 0
  • 0
anonymous タイトルなし
Python
7676786867867868
  • 0
  • 0
anonymous タイトルなし
Python
56757598
  • 0
  • 0
anonymous タイトルなし
Python
Fffffffff
  • 0
  • 0
anonymous タイトルなし
Python
import cv2
print(cv2)
import numpy as np
'''
# カメラのキャプチャを開始 --- (*1)
cam = cv2.VideoCapture(0)
while True:
    # 画像を取得 --- (*2)
    _, img = cam.read()
    # ウィンドウに画像を表示 --- (*3)
    cv2.imshow('PUSH ENTER KEY', img)
    # Enterキーが押されたら終了する
    if cv2.waitKey(1) == 13: break
# 後始末
cam.release()
cv2.destroyAllWindows()
'''

def find_rect_of_target_color(image):
  hsv = cv2.cvtColor(image, cv2.COLOR_BGR2HSV_FULL)
  h = hsv[:, :, 0]
  s = hsv[:, :, 1]
  mask = np.zeros(h.shape, dtype=np.uint8)
  mask[((h < 20) | (h > 200)) & (s > 128)] = 255
  contours, _ = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
  rects = []
  for contour in contours:
    approx = cv2.convexHull(contour)
    rect = cv2.boundingRect(approx)
    rects.append(np.array(rect))
  return rects


if __name__ == "__main__":
  capture = cv2.VideoCapture()
  while cv2.waitKey(30) < 0:
    _, frame = capture.read()
    rects = find_rect_of_target_color(frame)
    for rect in rects:
      cv2.rectangle(frame, tuple(rect[0:2]), tuple(rect[0:2] + rect[2:4]), (0, 0, 255), thickness=2)
    cv2.imshow('red', frame)
  capture.release()
  cv2.destroyAllWindows()
  • 0
  • 1
ガンマ@駆け出しエンジニア MTF MovingAvg2Line Cross
Python
//@version=4
strategy("MTF MovingAvg2Line Cross", overlay=true)
ES = input(title="MA1の選択", defval="EMA", options=["EMA", "SMA"])
ES2 = input(title="MA2の選択", defval="EMA", options=["EMA", "SMA"])
len = input(title='時間軸', type=input.resolution, defval="60")
res = input(defval=true, title="チェック=MTF表示")
res2 = res ? len : timeframe.period
fastLength = input(9)
slowLength = input(18)
price = close
fsma=sma(price, fastLength)
fema=ema(price, fastLength)
fast = ES == "EMA" ? fsma : fema
ssma=sma(price, slowLength)
sema=ema(price, slowLength)
slow = ES2 == "EMA" ? ssma : sema
mafast = security(syminfo.tickerid, res2,fast)
maslow = security(syminfo.tickerid, res2,slow)
if (crossover(mafast, maslow))
    strategy.entry("MA2CrossLE", strategy.long, comment="MA2CrossLE")
if (crossunder(mafast, maslow))
    strategy.entry("MA2CrossSE", strategy.short, comment="MA2CrossSE")
plot(mafast, color=color.lime)
plot(maslow, color=color.red)
  • 0
  • 1
あなたもコードを投稿しませんか?
投稿する