--- In [email protected], "Prashanth" <[EMAIL PROTECTED]> wrote: > > Hello, > > Suppose I have a formula which gives me Buy / Sell signals. Suppose Buy is given on Day 1 when the ticker is scanned. On Day 2, there is no signal, same for day 3, 4 and 5 till on the 6th day I get a Sell Signal. > > Is there a way to get which Signal is currently active for the scrip on say Day3 (I.e., if I give a Explore on Day 3, it should tell me currently we are in Buy Mode). > > I believe the syntax is quite simple, but unable to come up with the same and hence require help in that regard. > > Thanks in Advance > > Prashanth >
Hello Prashanth, This might be what you want. FLIP - Trading system toolbox (AFL 1.5) SYNTAX flip( ARRAY1, ARRAY2 ) RETURNS ARRAY FUNCTION works as a flip/flop device or "latch" (electronic/electric engineers will know what I mean) returns 1 from the first occurence of "true" signal in Array1 until a "true" occurs in Array2 which resets the state back to zero unil next "true" is detected in Array1... EXAMPLE buy = ExRem( buy, sell ); buy = Flip( buy, sell ); // this essentially reverts the process of ExRem - multiple signals are back again You can assign it to a variable and check if variable == 1 while still in the buy condition. Hope that helps. Cheers, Brian_z
