Profile Picture

Negative Price Series

Posted By lesliegk Last Year
Message
Posted Wednesday February 17 2016
For negative price series,

Case 1: 
when I set the stop loss to negative value with TargetPriceType.AbsolutePrice, 

PositionSettings settings = new PositionSettings();
settings.StopLossType = TargetPriceType.AbsolutePrice;
settings.StopLoss = -5;


The stop loss for the position would be set to zero. It seems like the stop loss for absolute price does not support negative value.

if (position != null && position.State == PositionState.Open && position.Type == PositionType.Long)
{
SymbolScript.OutputMessage(SymbolScript.Bars.Current.BarStartTime + "::stop loss price::" + position.StopLoss + "::position enter price::" + position.EntryPrice);
}

Case 2: 
when I set the stop loss to positive value with TargetPriceType.AbsolutePrice, 

PositionSettings settings = new PositionSettings();
settings.StopLossType = TargetPriceType.AbsolutePrice;
settings.StopLoss = 50000; 

The stop loss would be triggered at the same bar as the entry bar regardless the magnitude of the positive value


Is there anyway I could properly set the stop loss for a negative price series for  TargetPriceType.AbsolutePrice?

I believe it is similar problem to this thread 

http://www.rightedgesystems.com/forums/15450/Trailing-Stop-Loss-for-positions-with-negative-price?Keywords=Negative%20Price%20Series

Case 3:
For the chart display, the volume bar would be correctly displayed if the price is positive. If the price of the series is negative, the volume bar would be absent. Is there anyway to get around this to show the volume when the price is negative?

Thanks

Edited: Thursday February 18 2016 by lesliegk


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems