RicardoSantos

[RS]Gold to Custom Currency V0

Request for: sankar2389
Gold conversion from dollar to INR and to grams.
สคริปต์โอเพนซอร์ซ

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

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

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

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
//@version=2
study(title='[RS]Gold to Custom Currency V0', shorttitle='G', overlay=false)
grams_in_troy_ounces = 31.103
currency = input(title='Dollar Vs Currency desired to list gold:', type=string, defval='FX_IDC:USDINR', confirm=false)
gold_in_dollars = security('FX_IDC:XAUUSD', period, close)
dollars_in_currency = security(currency, period, close)
gold_oz_in_currency = gold_in_dollars * dollars_in_currency
gold_gm_in_currency = gold_oz_in_currency / grams_in_troy_ounces

plot(title='Oz', series=gold_oz_in_currency, color=black, transp=0, trackprice=true)
plot(title='Gm', series=gold_gm_in_currency, color=teal, transp=0, trackprice=true)