TradeIsAsset / Trades open on current asset

Posted By: j45p41

TradeIsAsset / Trades open on current asset - 08/14/19 18:48

Hi,

I am trying to identify when the current asset in a loop has an open trade. I can't use NumOpenTotal as it will also report on trades opened by other assets. When I try using TradeIsAsset in VC++ I get a sharing violation exception. How do I get number of trades open on the current asset please?
Posted By: laz

Re: TradeIsAsset / Trades open on current asset - 08/14/19 18:58

https://manual.zorro-project.com/winloss.htm

...Long: Results of all long trades with the current asset and algorithm. Including phantom trades, but not including pool trades.
...Short: Results of all short trades with the current asset and algorithm, including phantom trades, but no pool trades.
...Total: Results of all trades with all assets and algorithms, not including phantom trades.

NumOpenLong
NumOpenShort
Number of currently open trades with the current asset and algorithm, including phantom trades.

or https://manual.zorro-project.com/fortrades.htm
Posted By: j45p41

Re: TradeIsAsset / Trades open on current asset - 08/14/19 19:42

Perfect thank you - I was getting confused with current asset and algorithm - I thought it was totalling for the algo also.
Posted By: laz

Re: TradeIsAsset / Trades open on current asset - 08/14/19 22:09

you're welcome wink
Posted By: j45p41

Re: TradeIsAsset / Trades open on current asset - 08/15/19 19:06

Hi Iaz,

I have tested this and it when looping through two Assets and Asset 1 is in a trade, whilst in the loop for Asset 2 (which is not in a trade) NumOpenTotal = 1! Which leads me to believe that the statistic is aggregated for the Algo and not just the asset. I get around this by using NumOpenShort == 0 && NumOpenLong == 0 which is specific to the asset.

Regards,
Jas
© 2024 lite-C Forums