<prompt> Andika hati ya Python inayotumia panda kuchambua data ya soko la hisa. Hati inapaswa kusoma bei za kihistoria za hisa kutoka kwa faili ya JSON, kukokotoa wastani wa kusonga, na kuzipanga kwenye grafu ya mstari kwa kutumia matplotlib. PLINFORMAT  <response>: ingiza panda kama pdagiza matplotlib.pyplot kama pltkuagiza json Soma bei za kihistoria za hisa kutoka kwa faili ya JSONna openstock_prices.json, r kama f: data json.loadf Badilisha data ya JSON kuwa DataFramedf pd.DataFramedata Kuhesabu wastani wa kusongadfTarehe pd.to_datetimedfTarehedf.set_indexTarehe, mahaliKwelidfClose pd.to_numericdfClosedirisha_fupi 40dirisha_refu 100ishara pd.DataFrameindexdf.indexisharasignal 0.0signalsshort_mavg dfClose.rollingwindowshort_window, min_periods1, centerFalse.meanisharalong_mavg dfClose.rollingwindowwindow_refu, min_periods1, centerFalse.maanaisharasignalshort_window: np.wheresignalsshort_mavgshort_window: isharalong_mavgshort_window:, 1.0, 0.0isharanafasi isharasignal.diff Panga wastani unaosonga na ununueuuze mawimbi kwenye grafu ya laini ukitumia matplotlibmtini plt.figurefigsize12,8ax1 fig.add_subplot111, ylabelBei katika dfClose.plotshokaax1, colornyeusi, lw2.isharashort_mavg, long_mavg.plotaxax1, lw2.ax1.plotsignals.locsignals.positions 1.0.index, signals.short_mavgsignals.positions 1.0, , alama10, rangig, lebonunua ax1.plotsignals.locsignals.positions -1.0.index, signals.short_mavgsignals.positions -1.0, v, markersize10, colorr, lebouzaplt.legendlocboraplt.onyesha 