EG
Topics
04 Dec 2016, 12:02
1
974
1
11 Aug 2016, 13:23
2600
2
02 Aug 2016, 20:51
2861
5
Replies
egi.messito
03 Aug 2016, 16:51
Solved by passing
StrategyTest st = new StrategyTest(MarketData.GetSeries(TimeFrame));
But i can still not Print(""); from another class
what do i need to initiate in the other class to be able to Print?
@egi.messito
egi.messito
02 Aug 2016, 21:24
RE:
At a more basic level
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; namespace cAlgo { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NewcBot : Robot { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } public Testami t; protected override void OnStart() { // Put your initialization logic here t = new Testami(); } protected override void OnTick() { // Put your core logic here } protected override void OnStop() { // Put your deinitialization logic here } } public class Testami : Robot { public Testami() { var index = MarketSeries.Close.Count - 1; double high = MarketSeries.High[index - 3]; Print("test"); } } }
this would crash - why i cannot use Print and MarketSeries in the custom class?
@egi.messito
egi.messito
03 Aug 2016, 17:08
Solved:
Need to pass (this) in the custome class to get the Printing function into the log.
this is the easier way other then using reflection...
So in my code:
@egi.messito