I need some help with the order ticket system. I understand the concept fine, but I would like to know the precise syntax for doing the following:

1. Placing a market order. This is what I currently do:

OrderTicket thisOrder = MarketOrder("stock symbol","amount");

2. Storing the number of shares that was actually bought in a variable.

3. Storing the price at which the order was filled in a variable.

 

Regarding the order to sell, this is what I am currently doing for a market order:

OrderTicket thisOrder = MarketOrder("stock symbol",-"amount");

Is the above syntax correct? Also, instead of manually entering the quantity to sell, I would prefer to use the actual amount that was purchased and captured in a variable in 2. above.

Could somebody set me straight?

 

I would also greatly appreaciate it if anyone could confirm that the notify() feature only works in live trading or live paper trading. I have tried testing notify() in backtesting, but no cigar.

Thank you. 

 

Author