|
Konrad_729
|
Posted Wednesday, November 24, 2010
|
|
Group: Forum Members
Last Active: Wednesday, November 24, 2010
Posts: 3,
Visits: 17
|
This is a new version of a strategy, but there are some errors.
New Ichimoku.
I have modify some things
const
StrategyName = 'Ichimku 3.0';
var
History: TCandleHistory;
Account: TAccount;
Amount, Point: Double;
TraderRange, i: Integer;
IChimoku: TIndicatorIchimoku;
Stop, Limit: Integer;
procedure OnCreate;
begin
AddCandleHistorySetting(@History, 'History', 'EURUSD', CI_5_Minutes, 100);
History.OnNewCandleEvent := @OnNewCandle;
AddAccountSetting(@Account, 'Account', '');
AddFloatSetting(@Amount, 'Amount(Lots)', 1);
AddIntegerSetting(@Stop, 'Stop',15);
AddIntegerSetting(@Limit, 'Limit', 12);
AddIntegerSetting(@TraderRange, 'Trader Range', 0);
IChimoku := TIndicatorIchimoku.Create(History, 'Ichimoku Kinko Hyo');
IChimoku.PeriodTenkan := 9;
end;
procedure OnNewCandle;
begin
Point := History.Instrument.PointSize;
//if (IChimoku.GraphTenkan.Last(1) > IChimoku.GraphKijun.last(1)) then
if tradelist.count <1 then
begin
//if (IChimoku.GraphTenkan.Last(1)IChimoku.GraphKijun.last(2)) then
if (IChimoku.GraphChinkouSpan.Last(1)IChimoku.GraphTenkan.Last(2)) and (IChimoku.GraphChinkouSpan.Last(2)>IChimoku.GraphChinkouSpan.Last(1)) and (IChimoku.GraphChinkouSpan.Last(2)>IChimoku.GraphKijun.last(2)) {and (IChimoku.GraphTenkan.Last(1) begin
CreateOrder(History.Instrument, Account, Amount, bsSell,
History.Instrument.Buy + Point*Stop,
History.Instrument.Buy - Point*Limit, TraderRange, 'MACDTrade');
end;
// if (IChimoku.GraphTenkan.Last(1)>IChimoku.GraphKijun.last(1)) and (IChimoku.GraphTenkan.Last(2) if (IChimoku.GraphChinkouSpan.Last(1)>IChimoku.GraphTenkan.Last(1)) and (IChimoku.GraphChinkouSpan.Last(2) begin
{ CreateOrder(History.Instrument, Account, Amount, bsBuy,
History.Instrument.Sell - Point*10,
History.Instrument.Sell + Point*8, TraderRange, 'MACDTrade');
log ('The MACD crossed the Signal line bottom-up. A Buy position opened.'); }
end;
end;
end;
|
|
eMoe
|
Posted Saturday, December 04, 2010
|
|
Group: Forum Members
Last Active: 2 days ago @ 2:45 AM
Posts: 201,
Visits: 299
|
Hi, Konrad_729!
Can you describe conditions that you want to use?
They are not clear, that's why the code has errors
Best regards!
|
|
Admin
|
Posted Monday, January 30, 2012
|
Administrator
Group: Administrators
Last Active: 11 minutes ago
Posts: 266,
Visits: 1,336
|
Dear TheDutchGuy and Konrad_729,
The strategy that uses Ichimoku indicator is in the attachment.
The strategy opens Buy position if Tenkan and Kijun lines cross above the cloud.
The strategy opens Sell position if Tenkan and Kijun lines cross below or inside the cloud.
Best regards
-ACTFX© Forum Administrator
|