Envelopes Strategy

Posted By elvin Monday, November 02, 2009
Rated 4 stars based on 4 votes.
Add to Favorites1
Author Message
black
 Posted Tuesday, July 26, 2011
Supreme Being

Supreme Being - (1,425 reputation)Supreme Being - (1,425 reputation)Supreme Being - (1,425 reputation)Supreme Being - (1,425 reputation)Supreme Being - (1,425 reputation)Supreme Being - (1,425 reputation)Supreme Being - (1,425 reputation)Supreme Being - (1,425 reputation)Supreme Being - (1,425 reputation)

Group: Forum Members
Last Active: 3 hours ago
Posts: 462, Visits: 848
smallpips (7/25/2011)
Hi folks,
I'm trying to get to grips with the ACT stuff and I was wondering. Is it possible to configure an ACT file to run at a certain time of day? Let's say I know I'm not going to be at my screen at 1am but I want a trade entered at 1:30am based on the previous six 5m candlesticks. Is it possible to configure the file so that it will only run at a pre-determined time?



thanks for any assistance.




First, I don't know of any way to start a Strategy from a dead stop, except to do it manually. If you want to do this, ask Admin to be sure.

If all you want to do is make a running Strategy react at certain times, there is scripting info located at http://help.sysfx.com/documents/traders_manual/4.3/en_US/index.html?other_functions_2.htm under the Date/Time sub-heading. Also, check out the scripts in the Code Library.

Do a search on the word "time" in the ActTrader manual located here: http://help.sysfx.com/documents/traders_manual/4.3/en_US/index.html?icts_trader_application.htm.


Smile
Tuesday, July 26, 2011 by black
PataPata
 Posted Wednesday, July 27, 2011
Forum Member

Forum Member - (31 reputation)Forum Member - (31 reputation)Forum Member - (31 reputation)Forum Member - (31 reputation)Forum Member - (31 reputation)Forum Member - (31 reputation)Forum Member - (31 reputation)Forum Member - (31 reputation)Forum Member - (31 reputation)

Group: Forum Members
Last Active: 6 hours ago
Posts: 9, Visits: 36
31
Hi,
Would someone please help me!
When I try to run the strategy in real it gives me this error!
I don't know what to do,


EXCEPTION
ESmartException in TTraderDataProvider
CODE
20135
MESSAGE
Exception at trading strategy "NASA" in routine OnNewRate at Line:Column 123:10
Wrong Stop or Limit price: market rate 1.4497; order rate 1.4497;
DETAILS
ORA-20135: Wrong Stop or Limit price: market rate 1.4497; order rate 1.4497;
ORA-06512: at "EFOREX35.EXCEPTIONS", line 350



PataPata
We win!
roaddog
 Posted Wednesday, July 27, 2011
Supreme Being

Supreme Being - (123 reputation)Supreme Being - (123 reputation)Supreme Being - (123 reputation)Supreme Being - (123 reputation)Supreme Being - (123 reputation)Supreme Being - (123 reputation)Supreme Being - (123 reputation)Supreme Being - (123 reputation)Supreme Being - (123 reputation)

Group: Forum Members
Last Active: Wednesday, January 04, 2012
Posts: 41, Visits: 570
123
Try to change the limit or stop settings if you have 9999
roaddog
 Posted Sunday, July 31, 2011
Supreme Being

Supreme Being - (123 reputation)Supreme Being - (123 reputation)Supreme Being - (123 reputation)Supreme Being - (123 reputation)Supreme Being - (123 reputation)Supreme Being - (123 reputation)Supreme Being - (123 reputation)Supreme Being - (123 reputation)Supreme Being - (123 reputation)

Group: Forum Members
Last Active: Wednesday, January 04, 2012
Posts: 41, Visits: 570
123
Could somebody please look at this; I am trying to add a moving average, so that it would only open long positions above ma and short only below MA; closes should stay the same not connected to MA;
I am doing something wrong


const
StrategyName = 'Envelopes_Strategy_v.2.2';

var
History: TCandleHistory;
Account: TAccount;
Amount, Point: Double;
MaxPos : Integer;
Stop, Limit, Range, i: Integer;
Env: TIndicatorEnvelopes;//the Envelopes indicator
MA1: TIndicatorMovingAverage;

procedure OnCreate;
begin
AddCandleHistorySetting(@History, 'History', '', CI_1_Minute, 100);
History.OnNewCandleEvent := @OnNewCandle;
History.OnNewRateEvent := @OnNewRate;
AddIntegerSetting(@MaxPos, 'Max Open Trades', 1); // Change this to any number you like.
AddAccountSetting(@Account, 'Account', '');
AddFloatSetting(@Amount, 'Amount(Lots)', 1);
AddIntegerSetting(@Stop, 'Stop in pips', 20);
AddIntegerSetting(@Limit, 'Limit in pips', 60);

AddIntegerSetting(@Range, 'Trader Range', 2);

Env := TIndicatorEnvelopes.Create(History,'Envelopes indicator'); //setting for envelopes
//the envelopes parameters:
Env.Period := 14;
Env.Deviation := 0.05;

MA1 := TIndicatorMovingAverage.Create(History, 'Ma 1');
MA1.Period := 100;
end;


procedure OnNewCandle;
begin
Point := History.Instrument.PointSize;
//price crosses the top line -> sell
if (TradeList.Count < MaxPos) and (History.Last(1).Close > Env.TopGraph.Last(1)) and ((History.Instrument.Sell <= MA1.Graph.Last(0))) then
begin
if (TradeList.Count > 0) then
begin
for i:=TradeList.Count-1 downto 0 do
begin
if (TradeList.Get(i).Tag = 'BuyEnv') then
begin
CloseTrade(TradeList.Get(i), TradeList.Get(i).Amount, Range, TradeList.Get(i).Tag);
end;
end;
end;
CreateOrder(History.Instrument, Account, Amount, bsSell,
History.Instrument.Buy + Stop*Point,
History.Instrument.Buy - Limit*Point, Range, 'SellEnv');
end;


//price crosses the bottom line -> buy
if(TradeList.Count < MaxPos) and (History.Last(1).Close < Env.BottomGraph.Last(1)) and ((History.Instrument.Sell >= MA1.Graph.Last(0))) then
begin
if (TradeList.Count > 0) then
begin
for i:=TradeList.Count-1 downto 0 do
begin
if (TradeList.Get(i).Tag = 'SellEnv') then
begin
CloseTrade(TradeList.Get(i), TradeList.Get(i).Amount, Range, TradeList.Get(i).Tag);
end;
end;
end;
CreateOrder(History.Instrument, Account, Amount, bsBuy,
History.Instrument.Sell - Stop*Point,
History.Instrument.Sell + Limit*Point, Range, 'BuyEnv');
end;
end;
Admin
 Posted Friday, January 27, 2012
Administrator

Administrator - (1,036 reputation)

Group: Administrators
Last Active: 51 minutes ago
Posts: 266, Visits: 1,336
Dear roaddog,

You just need to add the type of MA, for example makSimple:

MA1 := TIndicatorMovingAverage.Create(History, 'Ma 1');
MA1.Period := 100;
MA1.Kind := makSimple;

The Envelopes Strategy v.3.1 (with Simple MA) is in attachment.


Best regards

-ACTFX© Forum Administrator
 Envelopes_Strategy_v3.1.acts (88 views, 3.18 KB)
Venus
 Posted Wednesday, May 09, 2012
Supreme Being

Supreme Being - (366 reputation)Supreme Being - (366 reputation)Supreme Being - (366 reputation)Supreme Being - (366 reputation)Supreme Being - (366 reputation)Supreme Being - (366 reputation)Supreme Being - (366 reputation)Supreme Being - (366 reputation)Supreme Being - (366 reputation)

Group: Forum Members
Last Active: 3 hours ago
Posts: 92, Visits: 1,711
366
Wink
Wednesday, May 09, 2012 by Venus

Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top