Example hedged grid code...

Created at 25 Oct 2022, 15:37
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
ST

stacepellegrino

Joined 24.12.2015

Example hedged grid code...
25 Oct 2022, 15:37


Does anyone have a reference to sample code that shows the logic of a basic hedged grid?

Upon trade entry I want to use set level thresholds to trigger and enter a hedged trade. Will I have to code this from scratch or is there something that would allow for me to do this such as:

TradeOperation buyOperation2nd = PlaceStopLimitOrderAsync(TradeType.Buy, SymbolName, volume, Symbol.Ask + (Symbol.PipSize * pipStep), Symbol.Ask + (Symbol.PipSize * pipStep), "BUY 2nd", StopOrderCallBack2nd);
                                        
TradeOperation sellOperation2nd = PlaceStopLimitOrderAsync(TradeType.Sell, SymbolName, volume, Symbol.Bid - (Symbol.PipSize * pipStep), Symbol.Bid - (Symbol.PipSize * pipStep), "SELL 2nd", StopOrderCallBack2nd);

With the above sample code I am having problems. I would appreciate clarification on this. 


@stacepellegrino