SetStopLoss("", CalculationMode.Ticks, 6, false);
SetProfitTarget("", CalculationMode.Ticks, 3);
CalculateOnBarClose = false;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (RSI(14, 3).Avg[0] < RSI30)
{
EnterLongLimit(DefaultQuantity, Low[1] + 2 * TickSize, "");
}
// Condition set 2
if (RSI(14, 3).Avg[0] > RSI70)
{
EnterShortLimit(DefaultQuantity, High[1] + 2 * TickSize, "");
EnterShortLimit(DefaultQuantity, High[1] + 2 * TickSize, "");
THat command to go "short" works just fine. It takes previous "close" of the bar, adds +2 ticks and tryes to go short from that point.
Example: PreviousBar = 1059.00.
Make OpenShort order on 1059,50.
Great.
But, shat should i do to make same trick with open long position?
EnterLongLimit(DefaultQuantity, Low[1] + 2 * TickSize, "");
Because that line also works, but it does the wrong thing really.
Example: PreviousBar = 1059.00.
Make OpenLong order on 1059,50.
So, basicly it makes a OpenLong order higher, then the previous bar closed, and ofc i need it to do the: Yeah.. go LONG, but not by +2 ticks higher order!
How to force it to make an LOngOrder which will look like that: Low[1] - 2 * TickSize
So, if last BAr was closed in like 1059,00.
How to set up an long order 2 ticks lower when that... at 1058,50 ?
Again, i`ve searched that forum, but didnt find anything here.
I`ve tryed to put "-" sign inside that command instead of "+"... but
seems so that command High[1] - 2 * TickSize, ""); doesnt works...
Any clues?
Comment