Issue with robot
Issue with robot
08 Dec 2012, 10:44
Hi,
I have a robot using different Indicators. I have checked many times but could not understand why robot have some problems below. It is quite strange:
1. It always places first postion late about 9 days eventhough the market satisfies the conditions.
2. The first position is always wrong and against the conditions.
3. Conditions are clear but the robot does not comply them all.
Please help
Replies
phamvanthanh
08 Dec 2012, 11:59
( Updated at: 21 Dec 2023, 09:20 )
18:00 is an up bar with close price is 1.29409 but the entry price is 1.29273 => the difference is 12 pips. What can cause this large diffenrence? Is the robot right with this?
@phamvanthanh
admin
10 Dec 2012, 16:06
Are you using this code in the OnBar event or the OnTick? In the backtest the ticks will be as close to reality as possible but not exact. Therefore there will be some difference from what you see on the chart and what your backtest results will show. If the entry is triggered in the OnTick this could be the reason why. It is not possible to know without looking at the whole code. You may send it to engage@ctrader.com for futher investigation.
@admin
phamvanthanh
08 Dec 2012, 11:37 ( Updated at: 21 Dec 2023, 09:20 )
I'd like to clearify more
I use print log to shows the Aroon up and Down values
if (Trnd.MarketTrend.LastValue > 0 && !longposition)
{
ClosePosition();
if (Trnd.MTdDiff.LastValue >= 0.00005)
{
if(Arn.Up.LastValue <= ArnOpenPercent)
{
Buy();
Print("Current Aroon Up at Buy is: {0}", Arn.Up.LastValue);
}
}
}
if (Trnd.MarketTrend.LastValue < 0 && !shortposition)
{
ClosePosition();
if(Trnd.MTdDiff.LastValue <= -0.00005)
{
if (Arn.Down.LastValue <= ArnOpenPercent)
{
Sell();
Print("Current Aroon Down at Sell is: {0}", Arn.Down.LastValue);
}
}
}
and the log shows
@phamvanthanh