input: Write a function to create a decision tree algorithm for predicting the value of a stock. The function loads a csv file containing stock data from the last 3 months, splits it into features and target, trains a decision tree classifier, and prints the model accuracy. The function should have the following signature: `def predict_stock_value(filename: str) -> float`.
  
  assert predict_stock_value("stockdata.csv") > 0.7
  assert predict_stock_value("empty_stockdata.csv") == 0.0
  assert predict_stock_value("corrupted_stockdata.csv") == -1.0
output: 
  def predict_stock_value(filename: str) -> float:
      try:
          import pandas as pd
          from sklearn.model_selection import train_test_split
          from sklearn.tree import DecisionTreeClassifier
          from sklearn.metrics import accuracy_score
          
          try:
              data = pd.read_csv(filename)
          except pd.errors.EmptyDataError:
              return 0.0
          except Exception:
              return -1.0
          
          if data.empty:
              return 0.0
          
          features = data.drop('target', axis=1)
          target = data['target']
          
          X_train, X_test, y_train, y_test = train_test_split(features, target, test_size=0.2, random_state=42)
          
          model = DecisionTreeClassifier()
          model.fit(X_train, y_train)
          
          y_pred = model.predict(X_test)
          accuracy = accuracy_score(y_test, y_pred)
          
          return accuracy
      except Exception:
          return -1.0
  