TVC:GOLD   CFDs on Gold (US$ / OZ)

```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt


data = pd.read_csv("gold_price.csv")


data = data.rolling(window=50).mean()

data = np.where(data > data, 1, 0)
data = np.where(data < data, 1, 0)

plt.figure(figsize=(12,6))
plt.plot(data, label="Price")
plt.plot(data, label="MA50")
plt.plot(data.loc[data == 1, "Price"], "go", label="Buy")
plt.plot(data.loc[data == 1, "Price"], "ro", label="Sell")
plt.legend(loc="upper left")
plt.show()
```
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.