EA builder Newbie error

 

Hi, I'm attempting to implement a parabolic SAR based strategy using a source created using EA Builder.

When I compile the code, the error shows:

 '{' - function definition unexpected

The error relates to the item highlighted below:

 

 {Strategy: Parabolic change - 1 day


  Created with EABuilder.com

  http://eabuilder.com}


Vars:

double TradeSize(1),

IntrabarPersist bool Filter(true), //used just before sending order

IntrabarPersist double PriceBuyMarket(0), //order open price

IntrabarPersist double PriceSellMarket(0); //order open price




//Close Long Positions, instant signal is tested first

if Parabolic(0.02) Crosses Below Open //Parabolic crosses below Candlestick Open

then

begin

Filter = (MarketPosition <> 0);

if Filter then

Sell ("exit2") next bar at market;

end;


//Close Short Positions, instant signal is tested first

if Parabolic(0.02) Crosses Below Open //Parabolic crosses below Candlestick Open

then

begin

Filter = (MarketPosition <> 0);

if Filter then

Buy To Cover ("exit1") next bar at market;

end;


//Open Buy Order, instant signal is tested first

if Parabolic(0.02) Crosses Below Open //Parabolic crosses below Candlestick Open

then

begin

Filter = true;

if Filter then

begin

PriceBuyMarket = Close;

Buy ("entry1") TradeSize contracts next bar at market;

end;

end;


//Open Sell Order, instant signal is tested first

if Parabolic(0.02) Crosses Above Open //Parabolic crosses above Candlestick Open

then

begin

Filter = true;

if Filter then

begin

PriceSellMarket = Close;

Sell Short ("entry2") TradeSize contracts next bar at market;

end;

end; Strategy: Parabolic change - 1 day


  Created with EABuilder.com

  http://eabuilder.com }


Vars:

double TradeSize(1),

IntrabarPersist bool Filter(true), //used just before sending order

IntrabarPersist double PriceBuyMarket(0), //order open price

IntrabarPersist double PriceSellMarket(0); //order open price




//Close Long Positions, instant signal is tested first

if Parabolic(0.02) Crosses Below Open //Parabolic crosses below Candlestick Open

then

begin

Filter = (MarketPosition <> 0);

if Filter then

Sell ("exit2") next bar at market;

end;


//Close Short Positions, instant signal is tested first

if Parabolic(0.02) Crosses Below Open //Parabolic crosses below Candlestick Open

then

begin

Filter = (MarketPosition <> 0);

if Filter then

Buy To Cover ("exit1") next bar at market;

end;


//Open Buy Order, instant signal is tested first

if Parabolic(0.02) Crosses Below Open //Parabolic crosses below Candlestick Open

then

begin

Filter = true;

if Filter then

begin

PriceBuyMarket = Close;

Buy ("entry1") TradeSize contracts next bar at market;

end;

end;


//Open Sell Order, instant signal is tested first

if Parabolic(0.02) Crosses Above Open //Parabolic crosses above Candlestick Open

then

begin

Filter = true;

if Filter then

begin

PriceSellMarket = Close;

Sell Short ("entry2") TradeSize contracts next bar at market;

end;

end; 

 

Any help in fixing this error will be greatly appreciated, and/or any extra help using EA builder.

Thanks :) 

 

Please use the SRC tool to clear your code for readers

 

 
rossiter: I'm attempting to implement a parabolic SAR based strategy using a source created using EA Builder.
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it

    • We hate EA builder
    • You couldn't be bothered to learn mql4, therefor there is no common language for us to communicate.
    • There are only two choices: learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem, but we are not going to debug your hundreds lines of code.
    • EA builder makes bad code counting up while closing multiple orders.
    • EA builder makes bad code Bars is unreliable (max bars on chart) volume is unreliable (miss ticks) Always use time. New candle - MQL4 forum
    • EA builder makes bad code Not adjusting for 4/5 digit brokers, TP/SL and slippage:
      double   pip        = StringFind(_Symbol,"JPY") < 0 ? 0.01 : 0.0001;
      int      slippage   = 3 * int(pip / _Point);
    • EA builder makes bad code not adjusting for ECN brokers.
    • EA builder makes bad code not checking return codes.
    • EATree uses objects on chart to save values - not persistent storage (files or GV+Flush.) No recovery (crash/reboot.)

  2. What you posted isn't code, go to your EA builder site and ask them for help.
Reason: