Channel Trading: Viking1961 500 step system

The problem is, that it’s actual very few people that master the primers to full. And if you are going to do calculations in a volatile market, You a almost sure to bee too later or getting out of balance very fast. Unlesh you have done Your homework in advance.

Of cause it is a possibility to make a check field in the setup, if you want to use primers or not.
In that way, you can choose if you want it to be semi automatic, or full automated.

The semi automated version should be very easy to code, as it is only the normal trades that is needed for that part. buystop and sellstop every 50 pips, with 50 pips TP. That is actually the basic.

But the big problem with forex is that you can’t force it to be inside a channel that you decide. But You have to keep ajusting to suit the market.

So if you just have the normal trades in the EA, then you need to be a master in the primers. And with that many people I have helped out with calculations, because they did not act fast anough. Then I can not recommend to do it manual before You really know the system in all aspects.

And by the way.
The primers are not ment to be a solution in a dangerous situation. But actual to prevent that a dangerous situation develops in the first place. So that You allways have capital to cover the drawdowns.

yes, an EA calculating primers, and setting them at the right time and place would be better than manual action,
where so many things can go wrong with the timing, greed, etc…

and there is already an option to deactivate auto primers in the settings, so people that would rather do this manually can do it…

CrissCross: Based on Webzone’s point of borders only being set by primers and the balance, what do you think of this pseudo code?

// Input parameters
extern bool UsePrimer = false;
bool LastTrendDirection = 0;
bool CurrentTrendDirection = 0;
bool AddPrimers = 0;
bool PrimersRunning = 0;

int init()
{
return(0);
}

int deinit()
{
return(0);
}

int start()
{
CheckOpenPositions();
DeleteFarAwayPendingOrders();
return(0);
}

double CheckOpenPositions()
{
// Step 1: Start initial trades
int total = OrdersTotal();
if(total==0)
OpenFirstTrade();

// Step 2: Find current trend direction
FindCurrentDirection();

// Step 3: Is equity falling 0.06% per pip?
DoINeedPrimers();

// Step 4: Check pending orders
if(AddPrimers)
{
if(CurrentTrendDirection == 0) //downtrend
CheckBuyLevelPendingOrders();
else {
CheckSellLevelPendingOrders(); //uptrend
}
}
else
{
CheckBuyLevelPendingOrders();
CheckSellLevelPendingOrders();
}

//Step 5: Check SL on any active primers
if(PrimersRunning)
{
ModifyRunningPrimers();
}

}

double OpenFirstTrade()
{
CalculateLotSize();
CheckBuyLevelPendingOrders();
CheckSellLevelPendingOrders();
}

double DeleteFarAwayPendingOrders()
{
}

double FindCurrentDirection()
{
// CurrentTrendDirection = Check last closed order versus current rate;
}

double DoINeedPrimers()
{
if(UsePrimer)
{
/* if (((Total units against trend – Total units with trend) / 10.000) / Balance) * 100) >= 0.06
{
if (CurrentTrendDirection == LastTrendDirection)
{
PlacePrimers();
AddPrimers = 1;
}
}
*/
}
}

double PlacePrimers()
{
// if(primer not already active in this range)
CalculatePrimerSize();
//Place order
PrimersRunning = 1;
}

double CheckBuyLevelPendingOrders()
{
}

double CheckSellLevelPendingOrders()
{
}

double CalculateLotSize()
{
// lot size closest to 0.5% (variable) of current balance
}

double CalculatePrimerSize()
{
// primer size = (Total units against trend / 4) / 10.000
}

double ModifyRunningPrimers()
{
// Set SL for running primers
}

Re
D

Thanks Dennis.

I was very busy in office the whole day. Just returned back. Am going to look into your algorithms and prepare the codes.
Until then find attached the basic version which places normal trades as Kent had suggested. I will explain with an example. You can start backtesting this version until I include the code to place primers as well.
Parameters
Lots = 0 (default). If at 0 then the lotsize will be calculated according to risk percentage that user will set.
Percent = 0.1(default). This is percentage that you want to risk per trade. If set to 1 the lotsize will be calculated according to 1% of available equity.
TP = Take profit.
Dist = 10 pips(default). this is how it sets sellstop/buystop against the trend . I explain details with an example below.
Other parameters I guess are known (UseSL, SL & Slip).
Eg.
pair: GBPUSD
First trade: 1.5300 (buy) Tp-1.5350
1.5296 (sell) TP - 1.5246
buystop: 1.5354 TP-1.5404
sellstop: 1.5242 TP - 1.5192

Lets say price goes up. First TP is hit at 1.5350. At the same time Buy is opened at 1.5354. If price continues 10pips ahead (set by parameter Dist) then a sellstop is placed at 1.5350.
Similar logic with downtrend.
If need more details then pls read Kent (Webzone’s) detailed explanation in previous posts.

Go ahead, try out the new EA and let me know how it performs. until then I try to program the EA for primers.

P.S
I had uploaded wrong EA. This mistake because I have been creating so many revisions and havent been deleting obsolete ones. I profusely apologize. This is the correct EA now.

Greenland strategy Rev1-1.zip (1.99 KB)

Looks good. Here are some testresults.

10.000 units, 1.000 units and 30 vs. 50 in TP.

Re
D

Hi,

I am trying Rev0-5 with TP=30 live for 2 days and it is working perfect (just normal trades, 16 trades closed in TP so far). So thank you.
Could you add a “step calculator” in the script? I think it would be useful for instance to get this info printed on top of the graph: “Current step: xx | Current Lot size: x.xx”.

Thank you,
Cristian

Dear Dennis,

I accidentally uploaded the wrong EA (twice). You have tested with the wrong version. I am sorry. I have double checked now and have attached the correct one. Test with this. You will find it matching to my explanations.
Sorry once again.

Oh good. I didn’t see that much difference in the results, but thought maybe it was just me not seeing the forest for the trees :wink:

In the new one, I can’t get OpenFirstTrade to function.

Not sure what your doing here:
double LotsNew=MathFloor(Free*Percent/100/OneLot/Step)*Step;
but the result comes out as 0, so no order is accepted.

Re
D

hahaha, nice one… i was trying to set lots to 0 as you explained, but it was not working… now i know why… :smiley:

Attached test reports for EURUSD & AUDUSD for one year with EA rev 1-1

Dennis,
For testing purpose use a bigger initial deposit and increase percentage value to 2 or 3 %.
This because I do not know your broker leverage etc.
The function Mathfloor rounds off to nearest lot step size as allowed by broker.
try increasing percent values and test. If it still doesn’t work let me know.

REV 1-1 AUDUSD JAN2011 TO FEB2012.pdf (810 KB)
REV 1-1 EURUSD JAN2011 TO FEB2012.pdf (973 KB)

Zepp - Errors happens when you are too excited!!

I like the results till now without primers. I wonder after primers how it will look. Test it and post results.
Me going to sleep now.

Found it. The default for Percent is set to 0.1. With my 3.000$ in the account and 25x it’s looking for a lot size below minimum. Changed it from 0.1 to 1 and it buys a 0.003 lot. At 0.5 I get 0.01 lots.

Re
D

Ooooh, pretty! Me like a lot!!!

Re
D

its working great… i have had it run for over 1 year now with 2000$ and 0.01 lots without stopout… thats pretty good whitout the primers :smiley:

only thing i find weird, is that even though we are running in % lot sizes, it does not seem to auto increase lot size?

EDIT: sorry, it just happend, but many month after it should have happend :slight_smile:

Actually, if you look at CC’s test sample, you will see that lots are fluctuating between 0.01 and 0.02 (depending on equity I assume). It never reaches 0.03 (probably too little ranging and too much trending), but with primers added I think we’re getting really close.

Re
D

Guys,

test with other pairs like GBPUSD & USDCAD etc for a longer time and see what comes out.

I will work on the primer strategy again 2mrw and try to complete it soon,

Goodnight all from Asia.

2010 to 2013 test on GBP/USD

https://dl.dropbox.com/u/93453374/rev1-1%20standart/rev1-1.pdf

the test is working very well, only problem was that the trade size was not escalated correctly, i started with 2000$ and 0.01 size trades, like in the channel investment plan calculator, and when the test ends im at 16831.47$ and should have 0.2 lot sizes with that amount of money if following the investment plan, but the biggest trades are only 0.06 lots…

as i see it, that is also the reason for not having a bigger $ amount after 3 years…

link to the investment plan calculator:
https://dl.dropbox.com/u/5267610/greenland%20investment%20plan%20calculation%20v.2.0.2.xlsx

Things are definatly looking better. My largest lot size was reached in the included test. I got up to 0.07 before it fell down to 0.01 again. Too bad the test reports don’t include details on free margin as balance isn’t enough to see why lot size is set to specific levels. Also, I seem unable to get tests to go beyond a few months. Your tests seem to cover longer period. Are there any settings in MT4 that has to be changed to get a longer test? I have GBPUSD1 from January 1999, but no matter what date range I ask for, only a few months are run before termination.

Re
D

Take a look at order 277 in your test. Opened August 30th 2010 at 1.53091 and closed January 13th 2012 with TP at 1.52591 for -11.83. Is that a bug in the tester or is the loss due to 18 months of some average swap costs?

Re
D

Primers is absolutely necessary.
Try testing an absolute one sided trend. For eg EURUSD from Nov 2009 to June 2010.

yes, i dont think anybody is doubting that m8 :wink:
if the lot sizes where increased correctly, i would also have been stopped out in my test, as i was pretty low on equty at a couple of times during the test, and think it was total luck that it didnt stop out :slight_smile: