Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
6 registered members (EternallyCurious, AndrewAMD, ricky_k, 7th_zorro, 2 invisible), 478 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Enumeration loop #482193
01/09/21 15:05
01/09/21 15:05
Joined: Aug 2020
Posts: 59
London
Neb Offline OP
Junior Member
Neb  Offline OP
Junior Member

Joined: Aug 2020
Posts: 59
London
Hi,

Need little help

In this loop:

for(open_trades)
{
if(TradeIsOpen && TradeProfit > 0.05*Balance)
{
TradeTrailLock = 0.60;
if(TradeIsShort)
{
printf("\nPetlja, date:%s",strdate(YMDHMS,wdate()));
TradeTrailLimit = max(TradeTrailLimit,TradePriceClose);
printf("\nTradeTrailLimit is %f",TradeTrailLimit);
printf("\nTradePriceClose is %f",TradePriceClose);
}
else
{
printf("\nPetlja, date:%s",strdate(YMDHMS,wdate()));
TradeTrailLimit = min(TradeTrailLimit,TradePriceClose);
printf("\nTradeTrailLimit je %f",TradeTrailLimit);
printf("\nTradePriceClose is %f",TradePriceClose);
}
}
}

TradeTrailLimit is always print as zero value - 0.
What I am missing ?

Thanks,

Neb

Re: Enumeration loop [Re: Neb] #482215
01/12/21 19:03
01/12/21 19:03
Joined: Aug 2020
Posts: 59
London
Neb Offline OP
Junior Member
Neb  Offline OP
Junior Member

Joined: Aug 2020
Posts: 59
London
I got value with watch(), but I am wondering why I am getting zero with printf. What I am missing ? frown

Neb

Re: Enumeration loop [Re: Neb] #482224
01/14/21 02:19
01/14/21 02:19
Joined: Jul 2017
Posts: 784
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 784
printf("\nTradePriceClose is %.5f",(var)TradePriceClose);

Trade structure variables need to be casted to var for printing out; RTFM

Re: Enumeration loop [Re: Zheka] #482230
01/14/21 12:10
01/14/21 12:10
Joined: Aug 2020
Posts: 59
London
Neb Offline OP
Junior Member
Neb  Offline OP
Junior Member

Joined: Aug 2020
Posts: 59
London

Thanks Zheka !


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1