- ago
Hi, trying to implement what worked in WL6.
XmlSerializer SM4FileXmlSerializer = new XmlSerializer(typeof(SM4LinkedListElement[]));

Below are three options and associated error messages.
#3 is from an existing post. Its title is given there.

using WealthLab.Backtest;
using System;
using WealthLab.Core;
using WealthLab.Data;
using WealthLab.Indicators;
using System.Collections.Generic;
using System.Runtime.Intrinsics.Arm;
using System.IO;


1 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
using System.Xml;
using System.Xml.Serialization;
XmlSerializer SM4FileXmlSerializer = new XmlSerializer(typeof(SM4LinkedListElement[]));
25477: The type name 'XmlSerializer' could not be found in the namespace 'System.Xml.Serialization'. This type has been forwarded to assembly 'System.Xml.XmlSerializer, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.

2 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
using System.Xml;
using System.Xml.XmlSerializer;
XmlSerializer SM4FileXmlSerializer = new XmlSerializer(typeof(SM4LinkedListElement[]));
23: The type or namespace name 'XmlSerializer' does not exist in the namespace 'System.Xml' (are you missing an assembly reference?)

3 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
From post: Can't use XmlSerializer: A non-collectible assembly may not reference a collectible assembly
using System.Xml.Serialization;
XmlSerializer SM4FileXmlSerializer = new XmlSerializer(typeof(SM4LinkedListElement[]));
25477: The type name 'XmlSerializer' could not be found in the namespace 'System.Xml.Serialization'. This type has been forwarded to assembly 'System.Xml.XmlSerializer, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.

Thanks!
0
158
Solved
3 Replies

Reply

Bookmark

Sort
- ago
#1
I downloaded the bundled solution which includes .NET
0
Glitch8
 ( 11.27% )
- ago
#2
This compiles and runs for me, but I have to enable System.Private.Xml in the Tools/Assembly References in WL8.

CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; using System.Collections.Generic; using System.IO; using System.Xml.Serialization; namespace WealthScript1 { public class MyStrategy : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) {          XmlSerializer SM4FileXmlSerializer = new XmlSerializer(typeof(SM4LinkedListElement[])); } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { if (!HasOpenPosition(bars, PositionType.Long)) { //code your buy conditions here } else { //code your sell conditions here } } //declare private variables below }        public class SM4LinkedListElement    {    } }
0
Best Answer
- ago
#3
Thank you! That worked.
0

Reply

Bookmark

Sort