
Wise, wise man. Why re-invent the wheel? All of my past indicators grew from bits & pieces of other code I found. These days, I'm doing things no one has posted so it's all from scratch but the fastest way to learn is to take what's already out thereQuote from gomifromparis:
Thx, coding was more like using other people's work : took the indicator code of CD on the dedicated Ninja forum thread, and took the bar charting logic from ValueChart indicator on Ninja indicators section..

Quote from gomifromparis:
Thx, coding was more like using other people's work : took the indicator code of CD on the dedicated Ninja forum thread, and took the bar charting logic from ValueChart indicator on Ninja indicators section...
Anyway, I set up a tick recorder, will see if I see differences using live and replay.
Problem is that the "correct" chart appears on replay...![]()
Quote from gomifromparis:
Well it seems an other guy got the exact same problem :
http://www.ninjatrader-support2.com/vb/showpost.php?p=38283&postcount=100
Maybe due to the event driven logic of OnMarketData : you have no guarantee ticks are dealt with in the correct order.
Question is : are live calculations usable and reliable ?
TCP is a reliable stream delivery service that guarantees delivery of a data stream sent from one host to another without duplication or losing data. Since packet transfer is not reliable, a technique known as positive acknowledgment with retransmission is used to guarantee reliability of packet transfers. This fundamental technique requires the receiver to respond with an acknowledgment message as it receives the data. The sender keeps a record of each packet it sends, and waits for acknowledgment before sending the next packet. The sender also keeps a timer from when the packet was sent, and retransmits a packet if the timer expires. The timer is needed in case a packet gets lost or corrupted.
TCP uses a sequence number to identify each byte of data. The sequence number identifies the order of the bytes sent from each computer so that the data can be transferred reliably and in order, regardless of any fragmentation, disordering, or packet loss that occurs during transmission. For every byte transmitted the sequence number must be incremented. In the first two steps of the 3-way handshake, both computers exchange an initial sequence number (ISN). This number can be arbitrary, and should in fact be unpredictable, in order to avoid a TCP Sequence Prediction Attack.
Sequence numbers and acknowledgments cover discarding duplicate packets, retransmission of lost packets, and ordered-data transfer. To assure correctness a checksum field is included (see TCP segment structure for details on checksumming).

Quote from gomifromparis:
Sure, but the NT logic is event-oriented.
Suppose you do some action in OnMarketData, and suppose the action is not complete when the next event is fired. What happens ? Events are buffered I suppose.
What I'm looking into is how they are unbuffered. If there's an asynchronous process somewhere, it could cause the problem because you can't guarantee a correct unbuffering sequence.