protected void OpenPosition(PositionOption position, int strength = 100) { if (position == PositionOption.Buy) { if (Buy != null) { if (_position == PositionOption.Sell) { ClosePosition(); } _position = PositionOption.Buy; _positionStrength = strength; Buy(strength); } } else if (position == PositionOption.Sell) { if (Sell != null) { if (_position == PositionOption.Buy) { ClosePosition(); } _position = PositionOption.Sell; _positionStrength = strength; Sell(strength); } } }
public SignalAdvisor(TickerReference tickerReference) { _SignalTimeframe = tickerReference; _position = PositionOption.None; _positionStrength = _positionFullStrength; }
/// <summary> /// Converts a List of Positions to a string of the given WKT-type. /// </summary> /// <param name="positionOption">Type to convert the Position-List to.</param> /// <param name="positionList">List of Positions to Convert.</param> /// <returns>Returns a WKT-string based on the List of Positions and the given type.</returns> private static string ConvertPositionListToWkt(PositionOption positionOption, ObservableCollection <Maps.Position> positionList) { var areaWkt = (positionOption == PositionOption.Area) ? "POLYGON ((" : "LINESTRING ("; foreach (var position in positionList) { areaWkt += string.Format(CultureInfo.InvariantCulture, "{0} {1},", position.Longitude, position.Latitude); } return(areaWkt.TrimEnd(',') + ((positionOption == PositionOption.Area) ? "))" : ")")); }
protected void ClosePosition() { if (Close != null) { if (_position != PositionOption.None) { _position = PositionOption.None; _positionStrength = _positionFullStrength; Close(); } } }
public IInvoicerOptions CompanyOrientation(PositionOption position) { Invoice.CompanyOrientation = position; return(this); }
public IInvoicerOptions CompanyOrientation(PositionOption position) { Invoice.CompanyOrientation = position; return this; }
/// <summary> /// Sets position type of popup /// </summary> /// <param name="obj">Binded object</param> /// <param name="value">Position type of popup</param> /// <since_tizen> 4 </since_tizen> public static void SetPositionOption(BindableObject obj, PositionOption value) => obj.SetValue(PositionOptionProperty, value);