When was the last time we were in stagflation?
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © brett0923
//@version=4
// #First I name the strategy
strategy("Stagflation backtesting ")
// # Collect and store the data for each economic indicator use
inflation_rate = security('USIRYY',"M", close)
interest_rate = security('US10Y', 'M', close  )
GDP_growth_rate = security('USGDPQQ', 'M', close )
//Command the strategy to enter a long position in the dollar when our indicators show or already showing signs of Stagflation
strategy.entry("enter long",true , 1000.0, when = inflation_rate > 8.0 and interest_rate >= 3.0 and GDP_growth_rate <= 1)

