forked from MeowBot/OpenQuant.API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScript.cs
More file actions
58 lines (58 loc) · 1.2 KB
/
Copy pathScript.cs
File metadata and controls
58 lines (58 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using SmartQuant;
using System;
using System.Windows.Forms;
namespace OpenQuant.API
{
public abstract class Script
{
private Form mainForm;
public Script()
{
}
public abstract void Run();
public void Invoke(Action action)
{
this.mainForm.Invoke(action);
}
public void AddTimer(DateTime dateTime, object data)
{
SmartQuant.Clock.AddReminder(new ReminderEventHandler(this.OnReminder), dateTime, data);
}
public void RemoveTimers()
{
SmartQuant.Clock.RemoveReminder(new ReminderEventHandler(this.OnReminder));
}
public void RemoveTimer(DateTime dateTime)
{
SmartQuant.Clock.RemoveReminder(new ReminderEventHandler(this.OnReminder), dateTime);
}
private void OnReminder(ReminderEventArgs args)
{
this.OnTimer(args.SignalTime, args.Data);
}
public virtual void OnTimer(DateTime dateTime, object data)
{
}
public virtual void OnSolutionStarting()
{
}
public virtual void OnSolutionStopping()
{
}
public virtual void OnSolutionStopped()
{
}
public virtual void OnSolutionStarted()
{
}
public virtual void OnSolutionOpened(string name)
{
}
public virtual void OnScriptStopped(string path)
{
}
public virtual void OnStop()
{
}
}
}