Signal appears after a specific date
4 replies
TJ#
9 years ago #112500
EA Signal indicator function
How to let EA Signal to appear only after a specific date? like 18th Aug 2014
Thanks.
Mark Fric
9 years ago #125952
you can use date functions to check for an date, or to check if current date is greater than your constant.
Mark
StrategyQuant architect
TJ#
9 years ago #125979
The Date func has only “=” and “” operators and does not has greater or lesser than operator. May be I have misunderstood your reply.
I tried both “=” and “” and not the results I am looking for.
I have attached my sqw file, are you able to show me how to do this right? Thanks very much.
IF
EMA 10(D1) > EMA 20(D1)
Date > 14 Aug 2014
THEN
PlaySound(“alert.wav”);
I would like the signal to appear after 14 Aug 2014 so that the chart is not clustered with signals.
Mark Fric
9 years ago #126019
The problem is that Date function returns date as a text only, so it cannot be compared to be bigger or smaller.
But there is a simple way how to compare a date, use:
Time > Custom Function: StrToTime(“2014.08.14”)
date format for StrToTime is is yyyy.mm.dd.
I’m attaching your strategy with this change.
Mark
StrategyQuant architect
TJ#
9 years ago #126036
Thank you very much.. 🙂
Viewing 4 replies - 1 through 4 (of 4 total)