Anda di halaman 1dari 2

[Parameter("TP for First Nukes", DefaultValue = "20")]

public double TPforFirstNukes { get; set; }

[Parameter("TP for First JPY Nukes", DefaultValue = "2000")]


public double TPforFirstJPYNukes { get; set; }

[Parameter("TP for High Nukes", DefaultValue = "0")]


public double TPforHighNukes { get; set; }

[Parameter("First Nuke Volume", DefaultValue = "10000")]


public double FirstNukeVolume { get; set; }

[Parameter("Highly Nuked Volume", DefaultValue = "320000")]


public double HighlyNukedVolume { get; set; }

protected override void OnStart()


{
// Put your initialization logic here
}

protected override void OnTick()


{
foreach (var position in Positions)
{
if (position.TradeType == TradeType.Buy &&
position.TakeProfit != position.EntryPrice + TPforFirstNukes *
Symbol.PipSize && position.VolumeInUnits >= FirstNukeVolume &&
position.VolumeInUnits < HighlyNukedVolume && position.SymbolCode
!= "GBPJPY" && position.SymbolCode != "EURJPY" &&
position.SymbolCode != "USDJPY" && position.SymbolCode !=
"CADJPY" && position.SymbolCode != "AUDJPY" &&
position.SymbolCode != "NZDJPY")
{
var takeprofit = position.EntryPrice + TPforFirstNukes *
Symbol.PipSize;
ModifyPosition(position, null, takeprofit);
}
if (position.TradeType == TradeType.Buy &&
position.TakeProfit != position.EntryPrice + TPforHighNukes *
Symbol.PipSize && position.VolumeInUnits >= HighlyNukedVolume)
{
var takeprofit = position.EntryPrice + TPforHighNukes *
Symbol.PipSize;
ModifyPosition(position, null, takeprofit);
}
if (position.TradeType == TradeType.Sell &&
position.TakeProfit != position.EntryPrice - TPforFirstNukes *
Symbol.PipSize && position.VolumeInUnits >= FirstNukeVolume &&
position.VolumeInUnits < HighlyNukedVolume && position.SymbolCode
!= "GBPJPY" && position.SymbolCode != "EURJPY" &&
position.SymbolCode != "USDJPY" && position.SymbolCode !=
"CADJPY" && position.SymbolCode != "AUDJPY" &&
position.SymbolCode != "NZDJPY")
{
var takeprofit = position.EntryPrice - TPforFirstNukes *
Symbol.PipSize;
ModifyPosition(position, null, takeprofit);