logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
picasso  
#1 Posted : Wednesday, December 18, 2013 12:29:53 PM(UTC)
picasso

Rank: Newbie

Groups: Registered, Registered Users
Joined: 11/5/2012(UTC)
Posts: 7

When I have a set up ready, for an example: (buy order) Cross( 10,RSI(C ,2 ) ). I want to buy next day one ATR(10) bellow the close or order canceled. I can’t find a way to do this.

Any help would be appreciated.

mstt  
#2 Posted : Wednesday, December 18, 2013 4:09:59 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Hi pica[censored]>
Although it's possible to carry an event forward and trigger a Buy one or more bars later (using a future event to confirm a current event), in my experience with the EST it's much easier (less potential problems) to code using a current event (trigger) one or more bars after a previous event (setup). In other words operating in the present and taking into account what's happened in the past. You cannot predict what's going to happen in the furture so why try and code that way? It can be done, of course, but the "what ifs" tend to complicate it, as I suspect you've already discovered.

Here's what I would start with. These buy orders take into account yesterday's CLOSE and ATR and buy close to but probably not at actually achievable prices. My code is not intended to be the solution, just some ideas on how to proceed.

{Buy Order (binary signals)}
Event:=Ref(Cross(10,RSI(C,2)),-1);
Target:=Ref(C-ATR(10),-1);
If(Event,If(LOW<=Target AND OPEN>=Target,1,
If(Min(LOW,OPEN)<=Target,1,0)),0);

{Buy Stop (price signals)}
Event:=Ref(Cross(10,RSI(C,2)),-1);
Target:=Ref(C-ATR(10),-1);
If(Event,If(LOW<=Target AND OPEN>=Target,Target,
If(Min(LOW,OPEN)<=Target,OPEN,0)),0);

Roy

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.