Not sure if it's correct but it should get you started.
//True Range Band
OptVar1 = Optimize("OptVar1",120,100,170,10);
OptVar2 = Optimize("OptVar2",30,18,38,4);
bandwidth = OptVar1 / 100.0; // bandwidth of Band
profit_target = 1.0;
Days = 2;
ema_center = 6; //...