Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, SBGuy, Petra), 801 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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