Gamestudio Links
Zorro Links
Newest Posts
myTMF - how to organize
by Grat. 01/23/21 17:57
Problem with Date in .t8 files
by pieran. 01/23/21 14:14
plot dash within bar
by TedMar. 01/22/21 00:36
Detrend = TRADES
by MMK. 01/21/21 09:37
Moving Average crossover
by Figurehunter. 01/20/21 21:46
AUM Magazine
Latest Screens
Scheherazade's Journey
Paradox Vector
The Space Between
Pogostuck: Rage With Your Friends
Who's Online Now
9 registered members (Quad, Eagle, Hajoha, kalmar, AndrewAMD, 3run, hast29, Dooley, 1 invisible), 497 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
pieran, Hajoha, minimeken, TraderTom, copernico
18576 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: 25
London
Neb Offline OP
Newbie
Neb  Offline OP
Newbie

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

Joined: Aug 2020
Posts: 25
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: 510
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 510
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: 25
London
Neb Offline OP
Newbie
Neb  Offline OP
Newbie

Joined: Aug 2020
Posts: 25
London

Thanks Zheka !


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1