बेहतर उपकरण अच्छा काम करते हैं -- व्यापार के सिद्धांतों का विश्लेषण करने के लिए अनुसंधान वातावरण का उपयोग करना सीखें

लेखक:लिडिया, बनाया गयाः 2022-12-27 16:33:51, अद्यतन किया गयाः 2023-09-20 09:17:27

img

बेहतर उपकरण अच्छा काम करते हैं ट्रेडिंग सिद्धांतों का विश्लेषण करने के लिए अनुसंधान वातावरण का उपयोग करना सीखें

हेजिंग शब्द मात्रात्मक ट्रेडिंग और प्रोग्राम ट्रेडिंग के क्षेत्र में एक बहुत ही बुनियादी अवधारणा है। डिजिटल मुद्रा के मात्रात्मक व्यापार में, अक्सर उपयोग की जाने वाली हेजिंग रणनीतियाँ हैंः वायदा-स्पॉट हेजिंग, क्रॉस-पीरियड हेजिंग और स्पॉट हेजिंग, जो अनिवार्य रूप से मूल्य अंतर के लिए लेनदेन हैं। शायद जब हेजिंग की अवधारणा, सिद्धांत और विवरण की बात आती है, तो कई छात्र जो अभी मात्रात्मक ट्रेडिंग के क्षेत्र में प्रवेश कर रहे हैं, वे अभी भी बहुत स्पष्ट नहीं हैं। इससे कोई फर्क नहीं पड़ता। आइए FMZ ट्रेडिंग प्लेटफॉर्म द्वारा प्रदान किए गए QuantAnalyze टूल का उपयोग करें ताकि इस ज्ञान को आसानी से सीखा और मास्टर किया जा सके।

FMZ क्वांट प्लेटफॉर्म के डैशबोर्ड में, टूल के पृष्ठ पर जाने के लिए विश्लेषण पर क्लिक करें:

img

यहाँ मैं सीधे विश्लेषण फ़ाइल अपलोडः यह विश्लेषण दस्तावेज बैकटेस्टिंग के दौरान वायदा-स्पॉट हेजिंग स्थिति के उद्घाटन और बंद होने की प्रक्रिया का विश्लेषण है। वायदा एक्सचेंज ओकेएक्स वायदा है, और अनुबंध एकquarterस्पॉट एक्सचेंज ओकेएक्स मुद्रा-मुद्रा लेनदेन है, और व्यापारिक जोड़ी हैBTC_USDT. फ्यूचर्स-स्पॉट हेजिंग के संचालन प्रक्रिया का विश्लेषण करने के लिए, आप निम्नलिखित विशिष्ट अनुसंधान वातावरण फ़ाइल देख सकते हैं, दो संस्करणों में लिखा गया हैः एक पायथन भाषा संस्करण, एक जावास्क्रिप्ट भाषा संस्करण।

खोज वातावरण पायथन भाषा फ़ाइल

फ्यूचर्स-स्पॉट हेजिंग के सिद्धांत पर विश्लेषण.ipynb [1] मेंः

from fmz import *
task = VCtx('''backtest
start: 2019-09-19 00:00:00
end: 2019-09-28 12:00:00
period: 15m
exchanges: [{"eid":"Futures_OKCoin","currency":"BTC_USD", "stocks":1}, {"eid":"OKX","currency":"BTC_USDT","balance":10000,"stocks":0}]
''')
# Create backtesting environment
import matplotlib.pyplot as plt
import numpy as np
# Import the plot library matplotlib and library numpy

[2] मेंः

exchanges[0].SetContractType("quarter")    # The first exchange object OKX Futures (eid: Futures_OKCoin) calls the function to set the current contract as a quarterly contract
initQuarterAcc = exchanges[0].GetAccount() # The initial account information of OKX Futures Exchange is recorded in the variable initQuarterAcc
initQuarterAcc

बाहर[2]: {संतुलन: 0.0, फ्रोजन बैलेंस: 0.0, स्टॉक: 1.0, फ्रोजन स्टॉक: 0.0}

[3] मेंः

initSpotAcc = exchanges[1].GetAccount()    # The initial account information of the OKX Spot Exchange is recorded in the variable initSpotAcc
initSpotAcc

बाहर[3]: {वित्तपोषण : 10000.0, जमे हुएवित्तपोषण : 0.0, स्टॉक : 0.0, जमे हुए स्टॉक : 0.0}

[4] मेंः

quarterTicker1 = exchanges[0].GetTicker()  # Get the futures exchange ticker, recorded in the variable quarterTicker1
quarterTicker1

बाहर[4]: समयः 1568851210000, उच्च : 10441.25002, कम : 10441.25, बिक्री : 10441.25002, खरीदें: 10441.25, अंतिम : 10441.25001, वॉल्यूम : 1772.0, ओपनइंटेरेस्ट: 0.0}

[5] मेंः

spotTicker1 = exchanges[1].GetTicker()     # Get the spot exchange ticker, recorded in the variable spotTicker1
spotTicker1

बाहर[5]: समयः 1568851210000, उच्च : 10156.60000002, कम : 10156.6, बिक्री : 10156.60000002, खरीदें: 10156.6, अंतिम : 10156.60000001, वॉल्यूम: 7.4443, ओपनइंटेरेस्ट: 0.0}

[6] मेंः

quarterTicker1.Buy - spotTicker1.Sell      # The price difference between going short on futures and going long on spot.

बाहर[6]: 284.6499999799999985

[7] मेंः

exchanges[0].SetDirection("sell")                       # Set up a futures exchange and trade in the direction of going short
quarterId1 = exchanges[0].Sell(quarterTicker1.Buy, 10)  # Futures go short to place orders. The order quantity is 10 contracts. The returned order ID is recorded in the variable quarterId1.
exchanges[0].GetOrder(quarterId1)                       # Check the details of the order with futures order ID quarterId1.

बाहर[7]: {Id: 1, मूल्य : 10441.25, राशि : 10.0, DealAmount: 10.0, औसत मूल्य : 10441.25, प्रकार: 1, ऑफसेट : 0, स्थिति : 1, अनुबंध प्रकार : तिमाही }

[8] मेंः

spotAmount = 10 * 100 / quarterTicker1.Buy                 # Calculate the currency equivalent of 10 contracts as the order quantity of the spot.
spotId1 = exchanges[1].Buy(spotTicker1.Sell, spotAmount)   # Place orders on the spot exchange
exchanges[1].GetOrder(spotId1)                             # Check the order details of the spot order ID of spotId1

बाहर[8]: {Id: 1, मूल्य : 10156.60000002, राशि : 0.0957, DealAmount: 0.0957, औसत मूल्य : 10156.60000002, प्रकार: 0, ऑफसेट : 0, स्थिति : 1, ContractType: bBTC_USDT_OKX}

आप देख सकते हैं कि आदेश quarterId1 और spotId1 आदेश पूरी तरह से भरे गए हैं, अर्थात खुली स्थितियों का हेजिंग पूरा हो गया है।

[9] मेंः

Sleep(1000 * 60 * 60 * 24 * 7)       # Hold the position for a while and wait for the price difference to become smaller to close the position.

प्रतीक्षा समय के बाद, स्थिति को बंद करने के लिए तैयार हो जाओ.quarterTicker2, spotTicker2और उन्हें प्रिंट करें। फ्यूचर्स एक्सचेंज ऑब्जेक्ट की लेनदेन दिशा शॉर्ट पोजीशन को बंद करने के लिए सेट की गई हैःexchanges[0].SetDirection("closesell")स्थिति को बंद करने का आदेश दें। बंद होने वाली स्थिति के आदेश का विवरण प्रिंट करें, जिसमें यह दर्शाया गया है कि बंद होने वाला आदेश पूरा हो गया है, बंद होने वाली स्थिति समाप्त हो गई है।

[10] मेंः

quarterTicker2 = exchanges[0].GetTicker()     # Get the current futures exchange ticker, recorded in the variable quarterTicker2
quarterTicker2

बाहर[10]: समयः 1569456010000, उच्च : 8497.20002, कम : 8497.2, बिक्री : 8497.20002, खरीदें: 8497.2, अंतिम : 8497.20001, वॉल्यूम : 4311.0, ओपनइंटेरेस्ट: 0.0}

[11] मेंः

spotTicker2 = exchanges[1].GetTicker()       # Get the current ticker of the spot exchange, recorded in the variable spotTicker2
spotTicker2

बाहर[11]: समय : 1569456114600, उच्च : 8444.70000001, कम : 8444.69999999, बिक्री : 8444.70000001, खरीदें: 8444.69999999, अंतिम : 8444.7, वॉल्यूम: 78.6273, ओपनइंटेरेस्ट: 0.0}

[12] मेंः

quarterTicker2.Sell - spotTicker2.Buy        # The price difference between closing a short futures position and closing a long spot position.

बाहर[12]: 52.5000200100003

[13] मेंः

exchanges[0].SetDirection("closesell")                   # Set the current trading direction of the futures exchange to close short positions.
quarterId2 = exchanges[0].Buy(quarterTicker2.Sell, 10)   # The futures exchange places an order to close a position and records the order ID to the variable quarterId2.
exchanges[0].GetOrder(quarterId2)                        # Check futures close out order details

बाहर[13]: {Id: 2, मूल्य : 8497.20002, राशि : 10.0, DealAmount: 10.0, औसत मूल्य : 8493.95335, प्रकार: 0, ऑफसेट : 1, स्थिति : 1, अनुबंध प्रकार : bquarter}

[14] मेंः

spotId2 = exchanges[1].Sell(spotTicker2.Buy, spotAmount) # The spot exchange places an order to close a position and records the order ID, which is recorded to the variable spotId2.
exchanges[1].GetOrder(spotId2)      # Check spot close out order details

बाहर[1]: {Id: 2, मूल्य : 8444.69999999, राशि : 0.0957, DealAmount: 0.0957, औसत मूल्य : 8444.69999999, प्रकार: 1, ऑफसेट : 0, स्थिति : 1, ContractType: bBTC_USDT_OKX}

[15] मेंः

nowQuarterAcc = exchanges[0].GetAccount()   # Get the current futures exchange account information, recorded in the variable nowQuarterAcc.
nowQuarterAcc

बाहर[15]: {संतुलन: 0.0, FrozenBalance: 0.0, स्टॉक: 1.021786026184, फ्रोज़ेनस्टॉक: 0.0}

[16] मेंः

nowSpotAcc = exchanges[1].GetAccount()      # Get the current spot exchange account information, recorded in the variable nowSpotAcc.
nowSpotAcc

बाहर[16]: {वित्तपोषणः 9834.74705446, FrozenBalance: 0.0, स्टॉक: 0.0, फ्रोज़ेनस्टॉक: 0.0}

आरंभिक खाते और चालू खाते की तुलना करके हेजिंग ऑपरेशन के लाभ और हानि की गणना की जाती है।

[17] मेंः

diffStocks = abs(nowQuarterAcc.Stocks - initQuarterAcc.Stocks)
diffBalance = nowSpotAcc.Balance - initSpotAcc.Balance
if nowQuarterAcc.Stocks - initQuarterAcc.Stocks > 0 :
    print("profits:", diffStocks * spotTicker2.Buy + diffBalance)
else :
    print("profits:", diffBalance - diffStocks * spotTicker2.Buy)

बाहर[17]: लाभः 18.72350977580652

अब देखते हैं कि हेजिंग लाभदायक क्यों है. हम चार्ट तैयार कर सकते हैं. वायदा मूल्य एक नीली रेखा है और स्पॉट मूल्य एक नारंगी रेखा है. दोनों कीमतें घट रही हैं. वायदा मूल्य स्पॉट मूल्य की तुलना में तेजी से घट रहा है.

[18] मेंः

xQuarter = [1, 2]
yQuarter = [quarterTicker1.Buy, quarterTicker2.Sell]

xSpot = [1, 2]
ySpot = [spotTicker1.Sell, spotTicker2.Buy]
plt.plot(xQuarter, yQuarter, linewidth=5)
plt.plot(xSpot, ySpot, linewidth=5)
plt.show()

बाहर[18]:

img

आइए मूल्य अंतर के परिवर्तन पर एक नज़र डालें। मूल्य अंतर हेजिंग उद्घाटन स्थिति के समय 284 से लेकर (यानी वायदा शॉर्ट, और स्पॉट लॉन्ग) बंद स्थिति के समय 52 तक होता है (फ्यूचर्स शॉर्ट स्थिति बंद, स्पॉट लॉन्ग स्थिति बंद) । मूल्य अंतर बड़े से छोटे तक होता है।

[19] मेंः

xDiff = [1, 2]
yDiff = [quarterTicker1.Buy - spotTicker1.Sell, quarterTicker2.Sell - spotTicker2.Buy]
plt.plot(xDiff, yDiff, linewidth=5)
plt.show()

बाहर[19]:

img

उदाहरण के लिए, a1 समय 1 पर वायदा मूल्य है, और b1 समय 1 पर स्पॉट मूल्य है। A2 समय 2 पर वायदा मूल्य है, और b2 समय 2 पर स्पॉट मूल्य है।जब तक समय 1 (a1-b1) पर वायदा स्पॉट मूल्य अंतर समय 2 (a2-b2) पर वायदा स्पॉट मूल्य अंतर से अधिक है, तब तक a1 - a2>b1 - b2 पेश किया जा सकता है। तीन स्थितियाँ हैंः (फ्यूचर्स और स्पॉट पदों की मात्रा समान है)

  1. a1 - a2 0 से बड़ा है, b1 - b2 0 से बड़ा है a1 - a2 वायदा मुनाफे के मूल्य अंतर को संदर्भित करता है, और b1 - b2 स्पॉट घाटे के मूल्य अंतर को संदर्भित करता है (क्योंकि स्पॉट लंबा चला गया, खरीद शुरू करने की कीमत स्थिति को बंद करने के लिए बेचने की कीमत से अधिक है, इसलिए पैसा खो जाता है), लेकिन वायदा मुनाफे स्पॉट घाटे से अधिक हैं। इसलिए यह समग्र रूप से लाभदायक है। यह स्थिति चरण में चार्ट के अनुरूप है [8]।

  2. a1 - a2 0 से बड़ा है, b1 - b2 0 से छोटा है a1 - a2 वायदा मुनाफे का मूल्य अंतर है, और b1 - b2 स्पॉट मुनाफे का मूल्य अंतर है (b1 - b2 0 से कम है, यह दर्शाता है कि b2 b1 से बड़ा है, अर्थात, स्थिति खोलने और खरीदने की कीमत कम है, और बिक्री और समापन की कीमत अधिक है, इसलिए यह लाभदायक है) ।

  3. a1 - a2 0 से कम, b1 - b2 0 से कम a1 - a2 वायदा घाटे का मूल्य अंतर है, और b1 - b2 स्पॉट लाभ का मूल्य अंतर है। चूंकि a1 - a2 > b1 - b2, a1 - a2 का पूर्ण मूल्य b1 - b2 के पूर्ण मूल्य से कम है, और स्पॉट लाभ वायदा घाटे से अधिक है। यह समग्र रूप से लाभदायक है।

ऐसा कोई मामला नहीं है जहां a1 - a2 0 से कम हो और b1 - b2 0 से अधिक हो, क्योंकि a1 - a2 > b1 - b2 परिभाषित किया गया है। इसी प्रकार, यदि a1 - a2 0 के बराबर है, क्योंकि a1 - a2 > b1 - b2 परिभाषित किया गया है, b1 - b2 0 से कम होना चाहिए। इसलिए, जब तक लघु वायदा और लंबे स्पॉट की हेजिंग विधि शर्तों को पूरा करती है a1 - b1 > a2 - b2, उद्घाटन और समापन स्थिति संचालन लाभ हेजिंग हैं।

उदाहरण के लिए, निम्न मॉडल एक मामला है:

[20] मेंः

a1 = 10
b1 = 5
a2 = 11
b2 = 9

# a1 - b1 > a2 - b2 launches: a1 - a2 > b1 - b2

xA = [1, 2]
yA = [a1, a2]

xB = [1, 2]
yB = [b1, b2]
plt.plot(xA, yA, linewidth=5)
plt.plot(xB, yB, linewidth=5)
plt.show()

बाहर[20]:

img

खोज वातावरण जावास्क्रिप्ट भाषा फ़ाइल

अनुसंधान वातावरण न केवल पायथन, बल्कि जावास्क्रिप्ट का भी समर्थन करता है मैं भी जावास्क्रिप्ट अनुसंधान वातावरण का एक उदाहरण देता हूंः

फ्यूचर्स-स्पॉट हेजिंग के सिद्धांत का विश्लेषण (जावास्क्रिप्ट).ipynb में [1]:

// Import the required package, click "Save settings" on the FMZ's "Strategy editing page" to get the string configuration and convert it to an object.
var fmz = require("fmz")                           // Import the talib, TA, and plot libraries automatically after import
var task = fmz.VCtx({
start: '2019-09-19 00:00:00',
end: '2019-09-28 12:00:00',
period: '15m',
exchanges: [{"eid":"Futures_OKCoin","currency":"BTC_USD","stocks":1},{"eid":"OKX","currency":"BTC_USDT","balance":10000,"stocks":0}]
})

[2] मेंः

exchanges[0].SetContractType("quarter")  // The first exchange object OKX Futures (eid: Futures_OKCoin) calls the function to set the current contract as a quarterly contract.
var initQuarterAcc = exchanges[0].GetAccount()  // The initial account information of OKX Futures Exchange is recorded in the variable initQuarterAcc.
initQuarterAcc

बाहर[2]: { बैलेंस: 0, फ्रोजन बैलेंस: 0, स्टॉक: 1, फ्रोजन स्टॉक: 0 }

[3] मेंः

var initSpotAcc = exchanges[1].GetAccount()     // The initial account information of the OKX Spot Exchange is recorded in the variable initSpotAcc.
initSpotAcc

बाहर[3]: { बैलेंस: 10000, फ्रोजन बैलेंस: 0, स्टॉक: 0, फ्रोजन स्टॉक: 0 }

[4] मेंः

var quarterTicker1 = exchanges[0].GetTicker()   // Get the futures exchange ticker, recorded in the variable quarterTicker1.
quarterTicker1

बाहर[4]: समयः 1568851210000, उच्चः 10441.25002, कमः 10441.25, बेचनाः 10441.25002, खरीदेंः 10441.25, अंतिम: 10441.25001, मात्राः 1772 ओपनइंटेरेस्ट: 0 }

[5] मेंः

var spotTicker1 = exchanges[1].GetTicker()     // Get the spot exchange ticker, recorded in the variable spotTicker1.
spotTicker1

बाहर[5]: { समयः 1568851210000, उच्चः 10156.60000002, कमः 10156.6, बेचनाः 10156.60000002, खरीदेंः 10156.6, अंतिम: 10156.60000001, मात्राः 7.4443 ओपनइंटेरेस्ट: 0 }

[6] मेंः

quarterTicker1.Buy - spotTicker1.Sell         // The price difference between going short on futures and going long on spot.

बाहर[6]: 284.6499999799999985 [7] मेंः

exchanges[0].SetDirection("sell")             // Set up a futures exchange and trade in the direction of going short
var quarterId1 = exchanges[0].Sell(quarterTicker1.Buy, 10)  // Go short futures to place orders. The order quantity is 10 contracts. The returned order ID is recorded in the variable quarterId1.
exchanges[0].GetOrder(quarterId1)                           // Check the details of the order with futures order ID quarterId1.

बाहर[7]: { आईडीः 1, कीमतः 10441.25, राशिः 10 सौदा राशिः 10, औसत मूल्यः 10441.25, प्रकारः 1, ऑफसेटः 0, स्थितिः 1, अनुबंध प्रकारः तिमाही }

[8] मेंः

var spotAmount = 10 * 100 / quarterTicker1.Buy                  // Calculate the currency equivalent of 10 contracts as the order quantity of the spot.
var spotId1 = exchanges[1].Buy(spotTicker1.Sell, spotAmount)    // Place orders on the spot exchange.
exchanges[1].GetOrder(spotId1)                                  // Check the order details of the spot order ID of spotId1.

बाहर[8]: { आईडीः 1, कीमतः 10156.60000002, राशिः 0.0957, सौदा राशिः 0.0957, औसत मूल्यः 10156.60000002, प्रकारः 0, ऑफसेटः 0, स्थितिः 1, अनुबंध प्रकारः BTC_USDT_OKX }

आप देख सकते हैं कि आदेश quarterId1 और spotId1 पूरी तरह से भरे गए हैं, अर्थात खुलने वाली पदों का हेजिंग पूरा हो गया है।

[9] मेंः

Sleep(1000 * 60 * 60 * 24 * 7)            // Hold the position for a while and wait for the price difference to become smaller to close the position.

प्रतीक्षा समय के बाद, स्थिति को बंद करने के लिए तैयार हो जाओ.quarterTicker2, spotTicker2और उन्हें प्रिंट करें। फ्यूचर्स एक्सचेंज ऑब्जेक्ट की लेनदेन दिशा शॉर्ट पोजीशन को बंद करने के लिए सेट की गई हैःexchanges[0].SetDirection("closesell")स्थिति को बंद करने का आदेश दें। बंद होने वाली स्थिति के आदेश का विवरण प्रिंट करें, जिसमें यह दर्शाया गया है कि बंद होने वाला आदेश पूरा हो गया है, बंद होने वाली स्थिति समाप्त हो गई है।

[10] मेंः

var quarterTicker2 = exchanges[0].GetTicker()    // Get the current futures exchange ticker, recorded in the variable quarterTicker2.
quarterTicker2

बाहर[10]: { समयः 1569456010000, उच्चः 8497.20002, कमः 8497.2, बेचनाः 8497.20002, खरीदेंः 8497.2, अंतिम: 8497.20001, मात्राः 4311, ओपनइंटेरेस्ट: 0 }

[11] मेंः

var spotTicker2 = exchanges[1].GetTicker()       // Get the current ticker of the spot exchange, recorded in the variable spotTicker2.
spotTicker2

बाहर[11]: { समयः 1569456114600, उच्चः 8444.70000001, कमः 8444.69999999, बेचनाः 8444.70000001, खरीदें: 8444.69999999, अंतिम: 8444.7, मात्रा: 78.6273, ओपनइंटेरेस्ट: 0 }

[12] मेंः

quarterTicker2.Sell - spotTicker2.Buy            // The price difference between closing short position of futures and closing long position of spot.

बाहर[12]: 52.5000200100003

[13] मेंः

exchanges[0].SetDirection("closesell")           // Set the current trading direction of the futures exchange to close short positions.
var quarterId2 = exchanges[0].Buy(quarterTicker2.Sell, 10)       // The futures exchange places an order to close the position, and records the order ID to the variable quarterId2.
exchanges[0].GetOrder(quarterId2)                                // Check futures closing position order details.

बाहर[1]: { आईडीः 2, कीमत: 8497.20002, राशिः 10 सौदा राशिः 10, औसत मूल्यः 8493.95335, प्रकारः 0, ऑफसेटः 1, स्थितिः 1, अनुबंध प्रकार: तिमाही }

[14] मेंः

var spotId2 = exchanges[1].Sell(spotTicker2.Buy, spotAmount)     // The spot exchange places an order to close the position, and records the order ID to the variable spotId2.
exchanges[1].GetOrder(spotId2)                                   // Check spot closing position order details.

बाहर[14]: { आईडीः 2, कीमत: 8444.69999999, राशिः 0.0957, सौदा राशिः 0.0957, औसत मूल्यः 8444.69999999, प्रकारः 1, ऑफसेटः 0 स्थितिः 1, अनुबंध प्रकारः BTC_USDT_OKX }

[15] मेंः

var nowQuarterAcc = exchanges[0].GetAccount()     // Get the current futures exchange account information, recorded in the variable nowQuarterAcc.
nowQuarterAcc                                     

बाहर[15]: { शेष राशिः 0, जमे हुए बैलेंसः 0, स्टॉकः 1.021786026184, जमे हुए स्टॉक्स: 0 }

[16] मेंः

var nowSpotAcc = exchanges[1].GetAccount()        // Get the current spot exchange account information, recorded in the variable nowSpotAcc.
nowSpotAcc

बाहर[16]: { शेषः 9834.74705446, जमे हुए बैलेंसः 0, स्टॉकः 0, फ्रोजनस्टॉक्स: 0 } आरंभिक खाते और चालू खाते की तुलना करके हेजिंग ऑपरेशन के लाभ और हानि की गणना की जाती है।

[17] मेंः

var diffStocks = Math.abs(nowQuarterAcc.Stocks - initQuarterAcc.Stocks)
var diffBalance = nowSpotAcc.Balance - initSpotAcc.Balance
if (nowQuarterAcc.Stocks - initQuarterAcc.Stocks > 0) {
    console.log("profits:", diffStocks * spotTicker2.Buy + diffBalance)
} else {
    console.log("profits:", diffBalance - diffStocks * spotTicker2.Buy)
}

बाहर[17]: लाभः 18.72350977580652

अब देखते हैं कि हेजिंग लाभदायक क्यों है. हम चार्ट तैयार कर सकते हैं. वायदा मूल्य एक नीली रेखा है और स्पॉट मूल्य एक नारंगी रेखा है. दोनों कीमतें घट रही हैं. वायदा मूल्य स्पॉट मूल्य की तुलना में तेजी से घट रहा है.

[18] मेंः

var objQuarter = {
    "index" : [1, 2],                                          // The index is 1, that is, the first time, the opening time, and 2 is the closing time.
    "arrPrice" : [quarterTicker1.Buy, quarterTicker2.Sell],
}
var objSpot = {
    "index" : [1, 2],
    "arrPrice" : [spotTicker1.Sell, spotTicker2.Buy],
}
plot([{name: 'quarter', x: objQuarter.index, y: objQuarter.arrPrice}, {name: 'spot', x: objSpot.index, y: objSpot.arrPrice}])

बाहर[18]: आइए मूल्य अंतर के परिवर्तन पर एक नज़र डालते हैं। मूल्य अंतर हेजिंग उद्घाटन पदों के समय 284 से लेकर (यानी वायदा शॉर्ट हो गया, और स्पॉट लंबा हो गया) बंद होने के समय 52 तक है (फ्यूचर्स की बंद छोटी स्थिति, और स्पॉट की बंद लंबी स्थिति) । मूल्य अंतर बड़े से छोटे तक है।

[19] मेंः

var arrDiffPrice = [quarterTicker1.Buy - spotTicker1.Sell, quarterTicker2.Sell - spotTicker2.Buy]
plot(arrDiffPrice)

बाहर[19]:उदाहरण के लिए, a1 समय 1 पर वायदा मूल्य है, और b1 समय 1 पर स्पॉट मूल्य है। A2 समय 2 पर वायदा मूल्य है, और b2 समय 2 पर स्पॉट मूल्य है।जब तक समय 1 (a1-b1) पर वायदा स्पॉट मूल्य अंतर समय 2 (a2-b2) पर वायदा स्पॉट मूल्य अंतर से अधिक है, तब तक a1 - a2>b1 - b2 पेश किया जा सकता है। तीन स्थितियाँ हैंः (फ्यूचर्स और स्पॉट पदों की मात्रा समान है)

  1. a1 - a2 0 से बड़ा है, b1 - b2 0 से बड़ा है a1 - a2 वायदा मुनाफे के मूल्य अंतर को संदर्भित करता है, और b1 - b2 स्पॉट घाटे के मूल्य अंतर को संदर्भित करता है (क्योंकि स्पॉट लंबा चला गया, खरीद शुरू करने की कीमत स्थिति को बंद करने के लिए बेचने की कीमत से अधिक है, इसलिए पैसा खो जाता है), लेकिन वायदा मुनाफे स्पॉट घाटे से अधिक हैं। इसलिए यह समग्र रूप से लाभदायक है। यह स्थिति चरण में चार्ट के अनुरूप है [8]।

  2. a1 - a2 0 से बड़ा है, b1 - b2 0 से छोटा है a1 - a2 वायदा मुनाफे का मूल्य अंतर है, और b1 - b2 स्पॉट मुनाफे का मूल्य अंतर है (b1 - b2 0 से कम है, यह दर्शाता है कि b2 b1 से बड़ा है, अर्थात, स्थिति खोलने और खरीदने की कीमत कम है, और बिक्री और समापन की कीमत अधिक है, इसलिए यह लाभदायक है) ।

  3. a1 - a2 0 से कम, b1 - b2 0 से कम a1 - a2 वायदा घाटे का मूल्य अंतर है, और b1 - b2 स्पॉट लाभ का मूल्य अंतर है। चूंकि a1 - a2 > b1 - b2, a1 - a2 का पूर्ण मूल्य b1 - b2 के पूर्ण मूल्य से कम है, और स्पॉट लाभ वायदा घाटे से अधिक है। यह समग्र रूप से लाभदायक है।

ऐसा कोई मामला नहीं है जहां a1 - a2 0 से कम हो और b1 - b2 0 से अधिक हो, क्योंकि a1 - a2 > b1 - b2 परिभाषित किया गया है। इसी प्रकार, यदि a1 - a2 0 के बराबर है, क्योंकि a1 - a2 > b1 - b2 परिभाषित किया गया है, b1 - b2 0 से कम होना चाहिए। इसलिए, जब तक लघु वायदा और लंबे स्पॉट की हेजिंग विधि शर्तों को पूरा करती है a1 - b1 > a2 - b2, उद्घाटन और समापन स्थिति संचालन लाभ हेजिंग हैं।

उदाहरण के लिए, निम्न मॉडल एक मामला है:

[20] मेंः

var a1 = 10
var b1 = 5
var a2 = 11
var b2 = 9

// a1 - b1 > a2 - b2 launches: a1 - a2 > b1 - b2

var objA = {
    "index" : [1, 2],
    "arrPrice" : [a1, a2],
}
var objB = {
    "index" : [1, 2],
    "arrPrice" : [b1, b2],
}
plot([{name : "a", x : objA.index, y : objA.arrPrice}, {name : "b", x : objB.index, y : objB.arrPrice}])

बाहर[20]:

यह कोशिश करो, लोग!


संबंधित

अधिक