QueueUserWorkItem (WaitCallback callBack, object state, ApartmentState apartmentState)
method
Сontrolled flow will be interrupted when the script
Syntax
public Thread QueueUserWorkItem (WaitCallback callBack,object state,ApartmentState apartmentState)
Parameters
callBack — WaitCallback
state — object
apartmentState — ApartmentState
Return
Thread
Returns controlled flow will be interrupted when the script
Example
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using PTLRuntime.NETScript;
using System.Threading;
namespace QueueUserWorkItemExample
{
public class QueueUserWorkItemExample : NETStrategy
{
public override void Init()
{
QueueUserWorkItem(new WaitCallback(ThreadProc));
}
public override void Complete()
{
QueueUserWorkItem(new WaitCallback(ThreadProc));
}
private void ThreadProc(object timer)
{
runAlert();
}
private void runAlert()
{
while(true){
Alert("Alert");
}
}
}
}
Discussion
Join PTMC community to post your comments
No comments yet. Be the first.
NETIndicator methods
- Alert (object[] args)
- ClearMarkers (int line)
- Comment (object[] args)
- Complete ()
- ConvertUTCTimeToSelectedTimeZone (DateTime timeUTC)
- CreateTimer (TimerCallback callback)
- CreateTimer (TimerCallback callback, object state, int dueTime, int period)
- CreateTimer (TimerCallback callback, object state, long dueTime, long period)
- CreateTimer (TimerCallback callback, object state, TimeSpan dueTime, TimeSpan period)
- CreateTimer (TimerCallback callback, object state, uint dueTime, uint period)
- GetHistoricalData (HistoricalDataRequest request)
- GetLastError ()
- GetLastErrorDescription ()
- GetValue (int line, int offset)
- GetValue (int line)
- IndicatorDigits (int digits)
- IndicatorShortName (string name)
- Init ()
- IsTesting ()
- NextBar ()
- OnPaintChart (object sender, PaintChartEventArgs args)
- OnQuote ()
- PlaySound (string fileName)
- Print (object[] args)
- QueueUserWorkItem (WaitCallback callBack)
- QueueUserWorkItem (WaitCallback callBack, object state)
- RemoveMarker (int line, int offset, Color color)
- SendEmail (string address, string subject, string body, string filename)
- SendEmail (string address, string subject, string body)
- SendEmail (string subject, string body)
- SetCloud (int cloudNumber, int index, int lineNumber, double value, int color, GradientMode gradientMethod)
- SetCloud (int cloudNumber, int index, int lineNumber, double value, int color, GradientMode gradientMethod, int offset)
- SetCloud (int cloudNumber, int index, double value1, double value2, int color1, int color2, GradientMode gradientMethod)
- SetCloud (int cloudNumber, int index, double value1, double value2, int color1, int color2, GradientMode gradientMethod, int offset)
- SetIndexDrawBegin (int index, int drawBegin)
- SetIndexEmptyValue (int index, double value)
- SetIndicatorLine (string name, Color color, int width, LineStyle style)
- SetLevelLine (string name, double level, Color color, int width, LineStyle style)
- SetLevelLine (string name, double level)
- SetLevelLine (int lineNumber, double level)
- SetLevelStyle (int draw_style, int line_width, int clr)
- SetLevelStyle (int levelIndex, int draw_style, int line_width, int clr)
- SetLevelValue (int index, double value)
- SetMarker (int line, int offset, Color color)
- SetValue (int line, int offset, double value)
- SetValue (int line, double value)
NETIndicator properties
- Accounts
- Ask
- Author
- Bid
- Comments
- Company
- Copyrights
- CurrentChart
- CurrentData
- DateOfCreation
- DrawSection
- ExpirationDate
- Fills
- HistogrammStyle
- Id
- Indicators
- Instruments
- LineColor
- LineNames
- LinesCount
- LineStyles
- LineTimeShift
- LineVisible
- LineWidth
- LineYFactor
- Orders
- Password
- Performance
- Point
- Positions
- ProjectName
- Refreshing
- SeparateWindow
- SingleThreadEvents
- SymbolCode
- Version
NETIndicator fields