Below is some basic example code that has one entrance and two exits (else if). One exit requires price analysis in the active trade.
Exit #1: Stochastic K crosses below D
and
Price > 63 at some point after the trade was entered.
Exit #2: Time >= 1557.
// Condition set 1 if (CrossAbove(Stochastics(7, 14, 3).K[1], Stochastics(7, 14, 3).D[1])) { EnterLong(100); } // Condition set 2 if (CrossBelow(Stochastics(7, 14, 3).K[1], Stochastics(7, 14, 3).D[1]) //&& //What is the code for "PRICE WAS GREATER THAN 63 AT SOME POINT AFTER THE TRADE WAS ENTERED" ) { ExitLong(100); } else if (ToTime(Times[0][0]) >= 155700) { ExitLong(100); }
Thanks in advance.
Comment