Hi,I'm testing a strategy that start from a distance of Pivot Point ( at the half or 50% ) with 1 day chart and setting for 6 days.
So I'm changing everyday the price of pivot point and I modify the price to start open position.
May someone help me to add the script for an automatic trading?
My strategy is :
const
StrategyName = 'Pivot';
var
History: TCandleHistory;
Account: TAccount;
Amount,Equitylevel:double; Point: Double;
ESPrice, ELPrice: Integer;
Stop, Limit: Integer;
procedure OnCreate;
begin
AddCandleHistorySetting(@History, 'Storico Candele', 'EURUSD', CI_1_Minute, 1);
History.OnNewCandleEvent := @NuovaCandela;
AddAccountSetting(@Account, 'Account', '');
AddFloatSetting(@Amount, 'Lotti', 2);
AddIntegerSetting(@ESPrice, 'Entry Stop Distance', 26);
AddIntegerSetting(@ELPrice, 'Entry Limit Distance', 20);
AddIntegerSetting(@Stop, 'Stop Loss', 400);
AddIntegerSetting(@Limit, 'Margine', 8);
end;
procedure NuovaCandela;
begin
Point := History.Instrument.PointSize;
if (History.Last(1).Close>1.3215)and (History.Last(1).Close<1.3235)
then
begin
Equitylevel:= xxxxx ;EquityLevel ;
if (account.EquityLevel>35000)
then
begin
CreateOrder (History.Instrument, Account, Amount, bsSell,
History.Instrument.Buy + 400*Point,
History.Instrument.Buy - Point*Limit, otELimit,'EntryLimitSell');
end;
end;
Thank you very much