Making a condition to sort before 9am and after 9am.

  • Thread starter YungTraderFromMontana
  • Start date
YungTraderFromMontana

YungTraderFromMontana

Well-known member
I've been trying this "GetTime() < 0859" and it has not worked. How do I differentiate between before 9 and after. I need this because less volume is traded early in premarket so in a script that uses volume I need to change the parameters to accommodate the lower volume.
 
M

mashume

Active member
VIP
I've been trying this "GetTime() < 0859" and it has not worked. How do I differentiate between before 9 and after. I need this because less volume is traded early in premarket so in a script that uses volume I need to change the parameters to accommodate the lower volume.
Code:
def beforeNine = if secondsTillTime(0900) > 0 then 1 else 0;

or

def afterNine = if secondsFromTime(0900) >= 0 then 1 else 0;
then you can do sommething like

Code:
def parameter = if beforeNine == 1 then valueA else valueB;
and use your valueA or valueB in another calculation.
maybe
 

Similar threads

Top