Crossabove round number ?

StrataSearch has many powerful features, with many techniques and approaches to explore. Here we discuss the things we've done, and the things we'd like to do.

Crossabove round number ?

Postby rjay » Wed Oct 07, 2015 11:09 am

I'd like to experiment with some trading rules based on entering at round numbers: for example, if Close CrossAbove a round number, then Buy at market. This will be in forex so a round number to me would be 1.50, 1.51, 1.52, etc on a xxxUSD pair, or perhaps 180.00, 181,00, etc. on a xxxJPY pair.

How would I write this in SS ?
rjay
 
Posts: 116
Joined: Wed Jul 26, 2006 6:51 am

Re: Crossabove round number ?

Postby Overload » Wed Oct 07, 2015 1:03 pm

You should be able to do that using the standard CrossAbove formula. For example, in your Entry String, you could use:

CrossAbove(close, 1.51)

The above will trigger an entry if the close prices crosses above 1.5.

Pete
Overload
 
Posts: 2247
Joined: Wed Nov 30, 2005 12:14 pm

Re: Crossabove round number ?

Postby rjay » Wed Oct 07, 2015 2:08 pm

Thanks - but I don't think I made myself clear. I want one rule for every round number, i.e 1.50, 1.51, 1.52, etc. Is that possible ? Maybe a cross above any number that ends x.xx000 for example ?
rjay
 
Posts: 116
Joined: Wed Jul 26, 2006 6:51 am

Re: Crossabove round number ?

Postby Overload » Wed Oct 07, 2015 2:48 pm

Ah, okay, now I think I understand. For that, maybe the truncate formula would work? For example, a rule like this:

trunc(close, 2) > ref(trunc(close, 2), -1)

I believe the above would only trigger if the decimal hundredths has increased (i.e. 1.51 to 1.52).

Pete
Overload
 
Posts: 2247
Joined: Wed Nov 30, 2005 12:14 pm

Re: Crossabove round number ?

Postby rjay » Wed Oct 07, 2015 2:54 pm

Ah, truncate, interesting. I'll play with that, thanks.
rjay
 
Posts: 116
Joined: Wed Jul 26, 2006 6:51 am


Return to General Discussion

cron