|
@ -803,8 +803,9 @@ cJSON *LP_ohlc_json(struct LP_ohlc *bar,struct LP_ohlc *prevbar) |
|
|
memset(&tmp,0,sizeof(tmp)); |
|
|
memset(&tmp,0,sizeof(tmp)); |
|
|
if ( bar->numtrades == 0 ) |
|
|
if ( bar->numtrades == 0 ) |
|
|
{ |
|
|
{ |
|
|
tmp = *prevbar; |
|
|
memset(&tmp,0,sizeof(tmp)); |
|
|
tmp.timestamp = bar->timestamp; |
|
|
tmp.timestamp = bar->timestamp; |
|
|
|
|
|
tmp.close = bar->close; |
|
|
tmp.numtrades = 0; |
|
|
tmp.numtrades = 0; |
|
|
tmp.relsum = tmp.basesum = 0.; |
|
|
tmp.relsum = tmp.basesum = 0.; |
|
|
} else tmp = *bar; |
|
|
} else tmp = *bar; |
|
|