Amibroker look a little like that.
SetOption("ActivateStopsImmediately",True);
SetTradeDelays(0,0,0,0);
condition1 = 1;// Name() == "TQQQ";
condition2 = Open < Ref(Close,-2) * 1.98;
condition3 = Ref(Close,-1) < Ref(MA(Close,5),-1);
snp500 = Foreign("SPY","Close");
condition4 = Ref(snp500,-1) <...