Good Afternoon fellow developers

 

I'm quite new to Futures trading, and currently, I'm working on a project for a trading company in brazil to hedge their regular operations in the petrol industry by utilizing correlation coefficient to further understand and predict the direction of the USDBRL to facilitate the closing of exchange rates on their operations. 

 

I have been using Quandl data from Nasdaq data Link, but due to its nature which is updated daily, I can't get a precise understanding of the nature of this operation I'm trying to perform. 

This is Code I will share below am just trying to add “6L” data to my algorithm with SMA. 

Any help is greatly appreciated, I look forward to sharing the complete project involving CFD, Interest Rates, and Forex and Futures. 

Thank You

class MuscularSkyBlueLeopard(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2022, 5, 10)  # Set Start Date
        self.SetCash(100000)  # Set Strategy Cash
        #self.AddForex("CADJPY", Resolution.Hour)
        #self.smaFast = self.SMA("CADJPY", 4)
        #self.smaSlow = self.SMA("CADJPY", 30)
        self.AddFuture("6L",Resolution.Hour )
        future = self.AddFuture(Futures.Currencies.BRL)
        future.SetFilter(timedelta(30), timedelta(182))
        #self.smaBrazilFast = self.SMA(future, 30)
        #self.smaBrazilSlow = self.SMA(future, 200)
        #-------------#USDBRL------------------------------------------------------
        #self.quandlCode_Brazil_USDBRL="FED/RXI_N_B_BZ"
        #self.AddData(QuandlCustomColumns, self.quandlCode_Brazil_USDBRL, Resolution.Minute, TimeZones.NewYork)
        #self.smaBrazilPrice = self.SMA(self.quandlCode_Brazil_USDBRL, 1)
        #self.smaBrazilFast = self.SMA(self.quandlCode_Brazil_USDBRL, 30)
        #self.smaBrazilSlow = self.SMA(self.quandlCode_Brazil_USDBRL, 200)

        
        
        
        
    def OnData(self, slice):
        
        for chain in slice.FutureChains.Values:
            contracts = chain.Contracts
            for contract in contracts.Values:
                pass
        
        #if self.smaBrazilFast.Current.Value > self.smaBrazilSlow.Current.Value:
            #self.SetHoldings("CADJPY",-0.1)
        #else:
            self.SetHoldings(future,1)
            
        
        self.Plot("CADJPY","CADJPY", self.Securities["CADJPY"].Price)
        self.Plot("CADJPY", "CADJPY Fast", self.smaFast.Current.Value)
        self.Plot("CADJPY", "CADJPY Slow", self.smaSlow.Current.Value)
        #self.Plot("PAIR","USDBRL", self.Securities["6L"].Price)
        #self.Plot("PAIR", "USDBRL Fast", self.smaBrazilFast.Current.Value)
        #self.Plot("PAIR", "USDBRL Slow", self.smaBrazilSlow.Current.Value)
#--------------------Import collumns----------------------------------------------------        
class QuandlCustomColumns(PythonQuandl):
    def __init__(self):
        self.ValueColumnName = "Value"