For answering the question what the advise functions actually do: exactly the same as the train and predict functions in R or Python. In train mode, they train the ML algo with the signals and objective. In test and trade, they return the predicted value. The difference of adviseLong and adviseShort is the name. They are 2 functions because you sometimes want to train 2 models.

That's the short version of the manual page. For the long version, read it and if you do not understand something, just tell us what it is. Only problem is when you really understood nothing of it... then it's difficult to help.