Choose Global Object Based On Account Hedge Type

 

I have two set of classes to deal with Hedge and Netting accounts. My EA code is like below

CTradeHedge TradeHedge;
CTradeNetting TradeNetting;

// Default Value
CTradeHedge Trade

In all my functions I've used "Trade" identifier. Like this

Trade.SellStop(sym, vol, price, sl, tp);

Is it possible to set global "Trade" identifier based on account hedge type?  I've tried changing it inside OnInit but it just becomes a local variable and the global variable doesn't change

Reason: