[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: EasyLanguage problem: BUY("A") from entry("B")



PureBytes Links

Trading Reference Links

First of all I think it was implicit that I have no signals that operate if
"currentbar = xy"...
besides that  I perfectly know what happened, and I found out the example
just because I know the problem, and because I unfortunately have signals
that can operate in the same bar (even if following different rules:) and I
cannot put them together because I can't know in advance if two of them will
decide to operate in the same bar, and I assure you that with 5 signals put
together this can happen once a week, and considering that 1 of the futures
that I trade has a risk amount of 200000 U$ you can imagine why I can't
risk.
So consider to have two signal that "unfortunately" have to operate in the
same bar (to have it simple please follow my example, and consider it just
an example to show where the problem can come out) and you'll see there's no
way to have the correct position after that bar.


> That's because you executed signals 2 and 3 on the SAME BAR.  When
> CurrentBar = 15, MarketPosition is still -1 from the short position. 
> And MarketPosition doesn't change until the CLOSE of the bar.  So you
> issued TWO EXITLONG signals and never issued a buy order.
> 
> Change signal 3 to "if currentbar=20" and you'll end up long one
> contract on bar 20, just like you wanted.
> 
> The method I suggested DOES work to add/subtract contracts.  It's a
> bit clumsy but it works.
> 
> Gary