Login Page - Create Account

Support Board


Date/Time: Sat, 18 Jan 2025 08:00:32 +0000



Post From: SC_RENKO_CLOSE sometimes return zero

[2018-01-31 04:02:51]
User841591 - Posts: 42
I get the close price as the code below and use (sc.GetBarHasClosedStatus() == BHCS_BAR_HAS_CLOSED && BuyTiggerLogic) to trigger the buy order. I sometimes find the NewOrder.Price1 get zero value and sometimes is correct. Pls advise how I can fix it.

SCFloatArrayRef R_Close = sc.BaseData[SC_RENKO_CLOSE];
NewOrder.Price1=sc.RoundToTickSize(R_Close[sc.Index]-sc.TickSize);
int Result = sc.BuyEntry(NewOrder);