I'm testing a hypothesis I have about the market but wanted to see if anyone would be willing to collaborate in order to see if this concept can be shown for at least a specific set of circumstances to be generally true. I am on the spectrum and new to a lot of this, but have tenacity as well as a passion for learning to make numbers go up.

I think it works because CNHUSD hadnt been released yet and that if there could be an empty placeholder for the entry of CNHUSD for Oanda the algorithm could work more generally. How would I do this? Am I wrong?

Any and all assistance is most welcome.

Here's the python code:

import random

class WellDressedAsparagusLeopard(QCAlgorithm):

def Initialize(self):
self.SetStartDate(2002, 5,31) # Set Start Date
self.SetCash(100000) # Set Strategy Cash
#self.AddEquity("SPY", Resolution.Tick)
#self.AddEquity("SPDN", Resolution.Tick)
#self.AddEquity("BND", Resolution.Tick)
self.AddForex("EURUSD", Resolution.Tick, Market.Oanda)
self.AddForex("CNHUSD", Resolution.Tick, Market.Oanda)
self.AddForex("USDEUR", Resolution.Tick, Market.Oanda)
def OnData(self, data: Slice):
'''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
Arguments:self.AddEquity("BTC", Resolution.Minute)
data: Slice object keyed by symbol containing the stock data

#self.AddForex("EURUSD", Resolution.Tick, Market.Oanda)
#self.AddForex("USDEUR", Resolution.Tick, Market.Oanda)
#self.AddForex("CNHUSD", Resolution.Tick, Market.Oanda)
# Make 100 trials.
n_tries = 1
# Lists to store results from stay and switch stratey
switch_results = []
for i in range(n_tries):
doors = ["EURUSD","USDEUR"]
switch_result = doors[0]
for i in range(n_tries + 1):
# Same code as above, for one trial
doors = ["EURUSD","USDEUR", "CNHUSD"]
switch_result = doors[2]
del doors[1:2]
switch_result = doors[0]
# Put results into result lists

if self.Portfolio.Invested:
for i in range(n_tries):
self.SetHoldings(switch_result, 0.01)
for i in range(n_tries +2):

# Lists to store results from stay and switch strategy

if not self.Portfolio.Invested:
for i in range(n_tries):
self.SetHoldings(switch_result, 0.01)