Basically, I want a 2:1 risk-reward strategy.
The stop-loss should be placed in the low of the previous bar (this I already got it).
Any help for the profit take logic would be appreciated.
Kind regards,
Jose
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1)
return;
// Set 1
if ((CandlestickPattern1[0] != 0)
&& (GetCurrentAsk(0) > EMA1[0])
&& (RSI1.Avg[0] > 50))
{
EnterLong(Convert.ToInt32(DefaultQuantity),"MyLong Entry" + CurrentBar);
SetProfitTarget("MyLongEntry" + CurrentBar, CalculationMode.Percent, 0.01);
SetStopLoss("MyLongEntry" + CurrentBar, CalculationMode.Price,(Low[1]), false);
}
}
Comment