Martingale EA - page 78

 

Show ask line

Files:
 

Did I find bug #2?

10 more to go!

ES

 
ElectricSavant:
screenshot with more detail

That's it ES,

The high of the previous bar was 1.9666. With a spread of 4, when the ASK hit 1.9670, it triggered a buy.

You're a great bug catcher ES.

 

Just call me Terminex!

ES

wolfe:
That's it ES,

The high of the previous bar was 1.9666. With a spread of 4, when the ASK hit 1.9670, it triggered a buy.

You're a great bug catcher ES.
 
ElectricSavant:
Did I find bug #2?

10 more to go!

ES

What makes you think there is ONLY 12 anyway?

 

TFX v1_6

Well, here it is for better of for worse!

A few changes to note:

1. You no longer need to use or worry about that annoying include file.

2. You now have a total of 51 external user input parameters to play with.

I post this while the market is closed in hopes that everyone will please read the external parameter comments, please take the time to do this so you understand all the options available to you.

Please read all the //comments in red.

Here are all the external parameters:

extern double Start_Lot_Size=0.1;//starting lot size for cycle

extern double Lot_Size_Increment=0.1;//Additional orders will increase by this amount

extern bool Long_Short_Balance=false;//will balance long and short order lots + add Balance_Weight if trend changes

extern double Balance_Weight=0.1;//amount over balanced long and short lot sizes you want to increase by with the trend

extern bool Double_Lotsize=false;//set to true if you want to just double every lotsize, Lot_Size_Increment ignored if true, will not work with weighted balance set to true

extern bool Choose_Own_Progression=false;//select true if you want te enter your own progression lot sizes below

extern double Trade_1=0;//Enter in your own trade progression lot sizes

extern double Trade_2=0;

extern double Trade_3=0;

extern double Trade_4=0;

extern double Trade_5=0;

extern double Trade_6=0;

extern double Trade_7=0;

extern double Trade_8=0;

extern double Trade_9=0;

extern double Trade_10=0;

extern double Trade_11=0;

extern double Trade_12=0;

extern double Trade_13=0;

extern double Trade_14=0;

extern double Trade_15=0;

extern double Trade_16=0;

extern double Trade_17=0;

extern double Trade_18=0;

extern double Trade_19=0;

extern double Trade_20=0;

extern int Max_Trades=20;//maximum number of trades allowed

extern bool Close_All_Max=false;//select true if you want ALL orders to close if Max_Trades is hit

extern bool Pyramid=true;//if true trades with trend, if false trades against trend

extern bool Auto_Restart=true;//set to true if you want EA to re-start after each cycle

extern bool Use_MA_Entry=false;//select true if you want moving average to decide starting direction

extern int Next_Trade=20;//next trade pip increment if Use_MA_Entry =true (will trade this many pips above OR below last order)

extern int MA_Period=7;//moving average period for calculation

extern int MA_Timeframe=60;//timeframe used for MA calculation, 1m=1, 5m=5, 15m=15, 30m=30, 1hr=60, 4hr=240, 1d=1440

extern bool Use_Kayvan_Method=true;//select to use kayvan's method

extern int Bar_Timeframe=60;//Bar Timeframe used to look back on, 1m=1, 5m=5, 15m=15, 30m=30, 1hr=60, 4hr=240, 1d=1440

extern int Bars_Look_Back=1;//number of bars looked back at from current bar for high and low

extern int EntryLag_Long=0;//number of pips above high to enter trade(ADD YOUR OWN SPREAD)

extern int EntryLag_Short=0;//number of pips below low to enter trade(ADD YOUR OWN SPREAD)

extern bool Last_Entry_Filter=false;//if true next high must be greater than last high, next low less than last low

extern bool Use_Trailing_Stop=true;//select true to use a trailing stop based on total $amount

extern double Trail_Start=10;//TS will start after this $Profit amount is reached

extern double TSLoss_Percent=50;//%Percentage of your HIGHEST profit you can lose before close all is performed

extern bool Close_By_Percent=false;//If true it will close by percent, if false it will close by Profit or Loss in $$

extern double TP_Percent=5;//will take profit if profit is greater than percent of account balance (close all orders)

extern double SL_Percent=10;//will stop loss if profit is less than percent of account balance (close all orders)

extern double Close_By_Profit=5;//close if >= to this $ amount

extern double Close_By_StopLoss=99999;//Amount of money to close all if lost

extern int Slippage=5;//slippage for ordersend command

extern int Number_Of_Tries=5;//Number of tries to send an OrderSend()command if not going through

extern bool Sound=true;//if true a sound will be played when an order goes through, and whwn a close all is performed

Those of you who have been following this thread for some time will have less problems understanding the user inputs. Those of you who are new, I suggest you read the thread thoroughly.

As stated in previous posts, this has been a real exercise in coding for me. With so many user options I'm sure there may be some bugs in the system.

I ask two things:

1. Please do not trade live until thorough testing has been performed.

2. Please report any potential bugs in the code so I can address the problem and try and correct it. Be patient!

There are so many options that the number of potential set up are close to endless. You really need to think hard about each parameter and what it does before attaching it to a chart. There will be some combinations that simply won't work well together. I fully expect this, as there is so much to think about.

Well, enough rambling. I hope you all have as much fun testing this as I have had trying to create it.

Happy testing!

A few bugs were fixed. Current version is TFX v1_6_rev1

Files:
 

v1_6 Revision

First set of bugs fixed. (I hope)

Close_All_Max will close all orders if set to true and you hit Max_Trades, no matter what exit strategy you are using. Even if you are using TS.

Also tried to fix the problem ES was having a few posts back.

Good Luck everyone.

Files:
 
wolfe:
Yes, one thing that won't work with long-short balance though is Choose_Own_Progression.

You must only choose ONE of these to be true:

Double_Lotsize

Long_Short_Balance

Choose_Own_Progression

Long_Short_Balance works like this:

Your first order will be whatever your Start_Lot_Size is set at. When it comes time for Long_Short_Balance to work it will balance your long and short lot sizes so they are fully hedged, plus add what ever amount you have selected for Balance_Weight, to the side with the trend.

I hope this makes sense.

Things could be changed later, but as of right now, this is how it works.

look at this picture below ,wolfe.

long- short balance = true

start lot size =.1

balance weight =.1

kayvan meyhod=true

and all the other options false.

is there anything more . that i diden`t do? or the positions are ok?

it puts the first entry 0.1 --the second and all remaining trades just --0.2

thanks

Files:
 
wolfe:
First set of bugs fixed. (I hope)

Close_All_Max will close all orders if set to true and you hit Max_Trades, no matter what exit strategy you are using. Even if you are using TS.

Also tried to fix the problem ES was having a few posts back.

Good Luck everyone.

Thank You Mr. Wolfe, for you have DONE.

How about your first setting Mr. ES ??? What do I have change with your setting ???

Thank you so MUCH for ALL of You.

Best regards,

Paulinge

 
kayvan:
look at this picture below ,wolfe.

long- short balance = true

start lot size =.1

balance weight =.1

kayvan meyhod=true

and all the other options false.

is there anything more . that i diden`t do? or the positions are ok?

it puts the first entry 0.1 --the second and all remaining trades just --0.2

thanks

That looks right kayvan. You always have .1 greater on your last order, which is your set balance weight.

You see, it is balancing itself every trade and adding the balance weight, so you always have a greater amount of TOTAL lot sizes open on your last (your trending) side.

Reason: