DevLucem

Trade

DevLucem ที่อัปเดต:   
Library "Trade"
A Trade Tracking Library

Monitor conditions with less code by using Arrays. When your conditions are met in chronologically, a signal is returned and the scanning starts again.

Create trades automatically with Stop Loss, Take Profit and Entry. The trades will automatically track based on the market movement and update when the targets are hit.

Sample Usage
Enter a buy trade when RSI crosses below 70 then crosses above 80 before it crosses 40.
Note: If RSI crosses 40 before 80, No trade will be entered.

rsi = ta.rsi(close, 21)

buyConditions = array.new_bool()
buyConditions.push(ta.crossunder(rsi, 70))
buyConditions.push(ta.crossover(rsi, 80))

buy = Trade.signal(buyConditions, ta.crossunder(rsi, 40))
trade = Trade.new(close-(100*syminfo.mintick), close +(200*syminfo.mintick), condition=buy)

plot(trade.takeprofit, "TP", style=plot.style_circles, linewidth=4, color=color.lime)
alertcondition(trade.tp_hit, "TP Hit")

method signal(conditions, reset)
  Signal Conditions
  Namespace types: bool
  Parameters:
    conditions (bool)
    reset (bool)
  Returns: Boolean: True when all the conditions have occured

method update(this, stoploss, takeprofit, entry)
  Update Trade Parameters
  Namespace types: Trade
  Parameters:
    this (Trade)
    stoploss (float)
    takeprofit (float)
    entry (float)
  Returns: nothing

method clear(this)
  Clear Trade Parameters
  Namespace types: Trade
  Parameters:
    this (Trade)
  Returns: nothing

method track(this, _high, _low)
  Track Trade Parameters
  Namespace types: Trade
  Parameters:
    this (Trade)
    _high (float)
    _low (float)
  Returns: nothing

new(stoploss, takeprofit, entry, _high, _low, condition, update)
  New Trade with tracking
  Parameters:
    stoploss (float)
    takeprofit (float)
    entry (float)
    _high (float)
    _low (float)
    condition (bool)
    update (bool)
  Returns: a Trade with targets and updates if stoploss or takeprofit is hit

new()
  New Empty Trade
  Returns: an empty trade

Trade
  Fields:
    stoploss (series__float)
    takeprofit (series__float)
    entry (series__float)
    sl_hit (series__bool)
    tp_hit (series__bool)
    open (series__integer)
เอกสารเผยแพร่:
v2 Added Stop and Limit orders.

Now you can track stop and limit orders. If you place a new trade with custom entry that is not the current market price, the trade will remain inactive until the market prices cross your entry point. Targets will not be tracked until we cross the threshold.

See these 2 examples of a buy limit. The green background activate when the trade is active.

🤖🤖🤖🤖🤖🤖🤖🤖🤖🤖
Automate TradingView Alerts
tradingview.to/anywhere
🥰😍😍🥰😍😍🥰😍😍🥰
ไลบรารีไพน์

จิตวิญญาณที่แท้จริงของ TradingView ผู้เขียนได้ตีพิมพ์รหัส Pine นี้เป็นไลบรารีโอเพนซอร์ซเพื่อให้โปรแกรมเมอร์คนอื่น ๆ จากชุมชนของเราสามารถนำไปใช้ซ้ำได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ไลบรารีนี้เป็นการส่วนตัวหรือในสิ่งพิมพ์โอเพนซอร์สอื่น ๆ แต่นำรหัสนี้มาใช้ซ้ำในสิ่งพิมพ์จะถูกควบคุมโดย กฎระเบียบการใช้งาน

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการใช้ไลบรารีนี้หรือไม่?

คัดลอกข้อความไปยังคลิปบอร์ดแล้ววางลงในสคริปต์ของคุณ