Gamestudio Links
Zorro Links
Newest Posts
MT4/5 Bridge: Stability & Latency?
by Zheka. 02/28/21 15:05
Zorro - import diff time zones csv
by Neb. 02/28/21 12:23
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/26/21 13:15
MACD / Stoch useage
by TraderTom. 02/25/21 21:22
findContract not finding a contract
by AndrewAMD. 02/25/21 11:53
New Zorro version 2.35
by jcl. 02/24/21 14:40
AUM Magazine
Latest Screens
Scheherazade's Journey
Paradox Vector
The Space Between
Pogostuck: Rage With Your Friends
Who's Online Now
9 registered members (Lozoteva, OptimusPrime, 1ND1G0, TraderTom, Dooley, AndrewAMD, 3run, NewBorn, 1 invisible), 480 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
VinVillin, Santofimio, LorraineJones, SkNiX, wongkrezi
18601 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: 42
London
Neb Online OP
Newbie
Neb  Online OP
Newbie

Joined: Aug 2020
Posts: 42
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: 42
London
Neb Online OP
Newbie
Neb  Online OP
Newbie

Joined: Aug 2020
Posts: 42
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: 512
Z
Zheka Online
User
Zheka  Online
User
Z

Joined: Jul 2017
Posts: 512
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: 42
London
Neb Online OP
Newbie
Neb  Online OP
Newbie

Joined: Aug 2020
Posts: 42
London

Thanks Zheka !


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1