12345»»»

Envelopes Strategy Expand / Collapse
Author
Message
Posted 11/2/2009 6:03:01 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 3/18/2010 1:10:20 PM
Posts: 75, Visits: 110
The Envelopes is similar to the Moving Average indicator. In consists of two Moving Averages, one displaced up, and one displaced down.It shows the range of the expected price behavior, so if price goes out of the area between two lines, it will come back to it.

My Envelopes Strategy opens a long position if the price goes above the bottom line. The strategy opens a sell position if th3 price goes below the top indicator line.



  Post Attachments 
Env.PNG (4,755 views, 31.75 KB)
Post #210
Posted 11/2/2009 6:10:05 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 3/18/2010 1:10:20 PM
Posts: 75, Visits: 110
Here is the script

  Post Attachments 
Env_Strategy.act (1,558 views, 2.72 KB)
Post #211
Posted 11/2/2009 10:17:38 PM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/12/2009 8:36:31 AM
Posts: 8, Visits: 10
Interesting... Looks like it works. How did you manage to write this? Did you read the manual?
Post #212
Posted 11/3/2009 6:23:08 AM


Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 9/30/2010 6:57:38 AM
Posts: 21, Visits: 20
I have tried to launch your script in the Tester. Looks like it really works

However, your strategy tells me the open rate of every position, but somehow it does not tell the close rate
Post #213
Posted 11/3/2009 6:27:20 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 3/18/2010 1:10:20 PM
Posts: 75, Visits: 110
Sniper, I did not read all the manual through I just looked at the examples. They are not as difficult as they seem to be.

Stone, what do you mean? Do you mean that there are no messages in the log about the close rate, or anything else?
Post #214
Posted 11/3/2009 9:31:18 PM


Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 10/6/2010 8:50:07 AM
Posts: 46, Visits: 84
Well done, Elvin!!
I have not written anything in the Strategy Editor yet. I have to try. Looks like it's even simpler than creating indicators. Perhaps I'm mistaken though.




br,
Phil Richter
Post #215
Posted 11/4/2009 2:40:57 AM


Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 9/30/2010 6:57:38 AM
Posts: 21, Visits: 20
Here in the picture you can see that Open Rate is shown, but clsoe rate isn't there.



  Post Attachments 
log.PNG (4,212 views, 15.54 KB)
Post #216
Posted 11/4/2009 6:48:05 AM


Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: 10/4/2010 6:19:12 AM
Posts: 67, Visits: 186
Look through the script, Stone.

Take note of these lines:

procedure OnTradeChange(const Action: TDataModificationType; const Trade: TTrade);
begin
if (Action=dmtInsert) then if (Trade.Tag='SellEnv') then log ('Sell trade opened.');
if (Action=dmtInsert) then if (Trade.Tag='BuyEnv') then log ('Buy trade opened.');
if (Action=dmtInsert) then log ('Open Rate.' +FloatToStr(Trade.OpenRate));
end;


As you can see, Elvin has determined here which messages should be output in the log. I guess, to see the close Rate, you need the line:


if (Action=dmtInsert) then log ('Close Rate.' +FloatToStr(Trade.CloseRate));






Sincerely,

Benjamin Hoover
Post #217
Posted 11/5/2009 7:58:43 AM
Administrator

Administrator

Group: Administrators
Last Login: 2/7/2012 9:02:20 AM
Posts: 245, Visits: 1,220
Scriptor is absolutely right.
However, please consider that in this case the Close rate output in the log is the Close rate at the moment when the position is opened, and not at the time when it is closed.

Best regards

-ACTFX© Forum Administrator
Post #218
Posted 11/5/2009 11:05:26 AM


Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 9/30/2010 6:57:38 AM
Posts: 21, Visits: 20
Thank you very much, scriptor!

Sorry, I am not a professsional programmer.
Post #219
« Prev Topic | Next Topic »

12345»»»

Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Admin

All times are GMT -5:00, Time now is 12:05pm


© 2009 Actforex.com Terms of Use