When using GetFirstSignal/GetNextSignal, if there are an entry signal (scalein) and an exit signal at the same bar, which of them will be the "FirstSignal"?
Entry Signals always come first?
Taking into account I just want the system to proccess signals at a certain order, and dont want to change anything else, I ask:
What if I want it to always process the entry first (scalein) and the exit last (get out of the whole position), how should I code it in the CBT section?
The safest thing is to not assume anything about the order of the signals, other than the fact that entry signals are guaranteed to be ordered by position score.
If you want to process entries first, then iterate through all the signals with GetFirstSignal/GetNextSignal and only process the ones where sig.IsEntry() is true. When you're ready to do the exits, then iterate through all the signals again and only process the ones where sig.IsExit() is true.
Within CBT GetFirst/NextSignal calls, entry signals come first, exit come afterwards. Within entry signals they are ordered by position score. Exit signals don't have specific order (they would be almost alphabetical but due to the fact that multiple threads running in parallel generate signals, exact ordering is not guaranteed).
Scale in/out are interleaved with exits in CBT's GetFirst/NextSignal.