Originally Posted By: DdlV
Hi Cstyle. A couple of thoughts:

When looking for help (in any forum), things like "The values being written" are too vague. Much better to also post the log or a snippet showing the values, bar where they occurred, etc., as well as why the values "don't seem right".

Re. the code, take a look at TradePriceClose vs. priceClose().

HTH.


DdlV, I swapped out TradePriceClose with priceClose, and updated the code in my post above. The strategy behaves the same, ie. not the way I would expect.

Here are the values in the log file that don't seem right:

Quote:
[NAS100::L6901] Long 1@1393 at 17:00

[1270: Thu 07.05.09 18:00] +0 +0 1/0
[1271: Thu 07.05.09 19:00] +0 +0 1/0
[1272: Thu 07.05.09 20:00] +0 +0 1/0
[1273: Thu 07.05.09 21:00] +0 +0 1/0
[1274: Thu 07.05.09 22:00] +0 +0 1/0
[1275: Thu 07.05.09 23:00] +0 +0 1/0
[1276: Fri 08.05.09 00:00] +0 +1 1/0
[1277: Fri 08.05.09 01:00] +0 +1 1/0
[1278: Fri 08.05.09 02:00] +0 +1 1/0
[1279: Fri 08.05.09 03:00] +0 +1 1/0 TradeStopLimit = 73151834298078158000000.000, TradeTrailLimit = 0.000 ATR = 6.676, priceClose = 1407.000 TradePriceOpen = 75262725486622238000000.000, TradePriceClose = 0.000
[NAS100::L6901] Trail 1@1393 Stop 1394 at 03:450


priceClose and ATR look fine in the log file. (Note that the asset is NAS100 using the data available from the zorro website.) All other values do not look right.

Why is TradePriceOpen so high? Shouldn't it be set to 1393?

Why is TradeTrailLimit set to 0? If TradePriceOpen is a huge number and I'm setting TradeTrailLimit equal to TradePriceOpen plus ATR, shouldn't TradeTrailLimit equal the huge number plus 6.676?

Again, thanks so much for your help!