Embedding AI predictions into EasyLanguage indicators
To embed the Volatility_Predictions
function into an EasyLanguage indicator, we can write the following:
var:color(0); if Volatility_Predictions=0 then color=yellow; if Volatility_Predictions=1 then color=red; if Volatility_Predictions=2 then color=darkred; if Volatility_Predictions=3 then color=darkgreen; if Volatility_Predictions=4 then color=green; plot1(Volatility_Predictions,"Volty_pred",color)
The Volatility_Predictions
command calls the EasyLanguage function created by importing the Python .txt
file. The plot1(Volatility_Predictions,"Volty_pred",color)
command will plot the volatility predictions
class in a TradeStation subchart, giving each class a different color, as in Figure 10.5:
Figure 10.5 – Volatility_Predictions indicator
In Figure 10.5, you can see the volatility predictions class day by day on a 60-minute gold futures chart. As we learned in the previous...