NE
Topics
12 May 2015, 23:22
2292
2
Replies
Neob1y
17 Sep 2013, 16:58
RE:
Neob1y said:
Hi, at the moment is not true, but it can be circumvented:
using System; using cAlgo.API; using cAlgo.API.Internals; using cAlgo.API.Indicators; using System.IO; namespace cAlgo.Indicators { [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC)] public class S1 : Indicator { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } string fileName = ""; string[] Pr = new string[1]; [Output("Main")] public IndicatorDataSeries Result { get; set; } protected override void Initialize() { if (Symbol.Code.ToString() == "EURUSD") { fileName = "C:\\Users\\***\\Documents\\cAlgo\\Sources\\Indicators\\Pary\\EURUSD.txt"; } if (Symbol.Code.ToString() == "EURGBP") { fileName = "C:\\Users\\***\\Documents\\cAlgo\\Sources\\Indicators\\Pary\\EURGBP.txt"; } } public override void Calculate(int index) { using (StreamWriter sw = new StreamWriter(new FileStream(fileName, FileMode.Create, FileAccess.Write))) { sw.WriteLine(MarketSeries.Close[MarketSeries.Close.Count - 1].ToString()); sw.WriteLine(MarketSeries.Close[MarketSeries.Close.Count - 2].ToString()); sw.WriteLine(MarketSeries.Close[MarketSeries.Close.Count - 3].ToString()); sw.WriteLine(MarketSeries.Close[MarketSeries.Close.Count - 4].ToString()); sw.WriteLine(MarketSeries.Close[MarketSeries.Close.Count - 5].ToString()); sw.WriteLine(MarketSeries.Close[MarketSeries.Close.Count - 6].ToString()); } Pr = File.ReadAllLines(fileName); Print(Pr[0]); } } }Drawback to this option, you need to add an indicator on each pair, which is needed. Also make a second indicator, which will handle the data.
@Neob1y
Neob1y
17 Sep 2013, 16:55
Hi, at the moment is not true, but it can be circumvented:
using System; using cAlgo.API; using cAlgo.API.Internals; using cAlgo.API.Indicators; using System.IO; namespace cAlgo.Indicators { [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC)] public class S1 : Indicator { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } string fileName = ""; string[] Pr = new string[1]; [Output("Main")] public IndicatorDataSeries Result { get; set; } protected override void Initialize() { if (Symbol.Code.ToString() == "EURUSD") { fileName = "C:\\Users\\***\\Documents\\cAlgo\\Sources\\Indicators\\Pary\\EURUSD.txt"; } if (Symbol.Code.ToString() == "EURGBP") { fileName = "C:\\Users\\***\\Documents\\cAlgo\\Sources\\Indicators\\Pary\\EURGBP.txt"; } } public override void Calculate(int index) { using (StreamWriter sw = new StreamWriter(new FileStream(fileName, FileMode.Create, FileAccess.Write))) { sw.WriteLine(MarketSeries.Close[MarketSeries.Close.Count - 1].ToString()); sw.WriteLine(MarketSeries.Close[MarketSeries.Close.Count - 2].ToString()); sw.WriteLine(MarketSeries.Close[MarketSeries.Close.Count - 3].ToString()); sw.WriteLine(MarketSeries.Close[MarketSeries.Close.Count - 4].ToString()); sw.WriteLine(MarketSeries.Close[MarketSeries.Close.Count - 5].ToString()); sw.WriteLine(MarketSeries.Close[MarketSeries.Close.Count - 6].ToString()); } Pr = File.ReadAllLines(fileName); Print(Pr[0]); } } }
@Neob1y
Neob1y
28 May 2015, 20:18
RE:
mazvis said:
Hi, baktest it works only with the connected terminal to the Internet and logged on account.
@Neob1y