Hi everyone!
Can anyone show me how to code a "cancel function" for Buy/Sell and Stop/Limit strategies in PaperTrader??
If I have a particular code for example to trigger a Buy with Profit targets and place Sell stops at the same time, how would one write code to cancel these functions??? ( I borrowed these from Brad Matheny codes)
Example: Trade.Buy(getSymbol(), DefEntryContracts, PaperTradeBroker.Market);
Trade.Sell(getSymbol(), DefEntryContracts, PaperTradeBroker.Stop, nStopPrice);
..... if a certain Profit Target was reached and fulfilled, what must I write to cancel the above orders and correctly route this to the papertrader?
I know I can manually do this by right-clicking in the "broker window" and cancel , but I am interested in automated trading , and want to accomplish this automatically with code.
Thanks to all that can help!!!!!
Angelo
Can anyone show me how to code a "cancel function" for Buy/Sell and Stop/Limit strategies in PaperTrader??
If I have a particular code for example to trigger a Buy with Profit targets and place Sell stops at the same time, how would one write code to cancel these functions??? ( I borrowed these from Brad Matheny codes)
Example: Trade.Buy(getSymbol(), DefEntryContracts, PaperTradeBroker.Market);
Trade.Sell(getSymbol(), DefEntryContracts, PaperTradeBroker.Stop, nStopPrice);
..... if a certain Profit Target was reached and fulfilled, what must I write to cancel the above orders and correctly route this to the papertrader?
I know I can manually do this by right-clicking in the "broker window" and cancel , but I am interested in automated trading , and want to accomplish this automatically with code.
Thanks to all that can help!!!!!
Angelo