Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Nymphodora), 972 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783
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