Channel Trading: Viking1961 500 step system

This was worrisome. We’ve been operating under the assumption that the correct balance of primers will lead to a top and a bottom border with long primers above, regs in the middle, and short primers underneath. Then at some point profits will increase equity enough that we can lift the top border and/or lower the bottom border and trade regular orders in a larger “channel” while still maintaining sufficient equity and free margin.

If you add too many primers the “channel” will contract as longs are needed lower and shorts are needed higher, which eventually will collapse the whole grid.

It sounds to me like you’re saying above that primers will be mixed in with the regular trades rather than being just on the borders. Is this correct?

While we can add manual primers, it sounds like we’re on the wrong track if this is the case.

Re
D

Michael, Dennis, Zepp & Webzone,

Thank you for all the effort and the advices.
I am glad to say that the EA is almost complete and I shall be releasing it tomorrow after a few more tests.

D-> I have used primer logic very similar to how you have stated. As I will be in office tomorrow, i wont get much time to write details so I write the basic logics of the EA as it has been developed now. I will post the EA tomorrow.
[B][U]At start[/U][/B]

  1. Regular Buy & Sell trade start at normal lot size. For the sake of the first revision I have kept lot sizes static. Will change it to autolot size in the next revision.
  2. Lets say price is moving down and you have a lot of buy trades as you go down.
  3. Drawdown will be calculated. At user defined Drawdown (lets say 50% as eg), EA will place channelbottom value at the current price.
  4. Primers will be placed below the next normal sell trade that is placed below ChannelBottom and normal trades will be stopped.
  5. Three types of Primers will be opened: Main, Secondary and Sub primers. Each primers can be set their own step and TP values. Lockinpip is only available for main and secondary. It is assumed that sub-primers will have very short TP according to Michael’s advice.
  6. The lot sizes of primers are autocalculated. Here I have taken Webzones idea:
    Main primers = 3 X (Total Normal Buys open - Total normal Sells open) (for a sell primer) {vice versa for Buy primer}
    Secondary primer = 1/2 of Main primer
    Sub-primer = 1/3 of Main primer
    I felt that Webzones idea for this is correct as if we have more Buy trades open then a bigger sell primer should be there to counter the no of Buy open. A 3XNormal Buy lot may not be enough. But we can discuss it after you all test it out.
  7. No primers are replaced if they are hit by SL.
  8. ChannelBottom value dynamically follows Primers. Currently when a 3rd Main primer is opened ChannelBottom value will be set to the level of 1st primer. I have currently placed it like that. We are free to change it according to pair used and other parameters if felt best.
  9. Opposite order Buystop of normal lot size is placed above ChannelBottom for regular trades to resume if price retraces back.
  10. At any point of time I feel only one primer from each type should remain open if price retraces back. So the current EA performs as such.
  11. Lets say now price retraces back above CChannelbottom. Normal trades will resume.
  12. Drawdown is again calculated and if in this case No of sell lots is more than No of Buy lots then ChannelTop is placed when Drawdown level reaches.
  13. Buy Primers are placed with primer sizes auto calculated.

Basically the above is most of the important parts.
Will explain the user input parameters when I post the EA tomorrow.

Regards
CC

D,

That is not worrisome. It is a fact which we cannot escape but can counter with placing effective primers upon drawdown reached and change equity.

the real problem lies in coding.
The EA places comment of “primer Buy” or “Primer Sell” when placing primers. The problem with the comment section and the magic numbers is that these are set during order open and cannot be changed. So if at a later stage an open primer reaches the size off a normal trade and we want to make it a normal trade then, I am unable to code it in the EA.

That is something I am researching on. If it doesnt work i have another solution. I will explain it in detail later this week after you have tested the EA i post tomorrow.

We are on the right track and I am confident we are close to reaching a working EA.

Regards
CC

Instead of “turning a primer into a reg”, just set its TP to OrderOpenPrice so it will close as soon as possible, and add a new regular order. You’ll get a hit for new spread, but it’s easy to include an if statement so that any order where OrderTakeProfit()==OrderOpenPrice() is ignored from then on. I already do this in my code and it works great.

The primer logic I’m currently asking about is whether primers will be added below channelTop and above channelBottom. That would most definitely create a problem for auto-trading using our current way of setting things up.

Re
D

Therein lies the problem:
There can be a case when drawdown is reached below current ChannelTop. In that case EA will move the ChannelTop lower. But since there exist a set of primers already, the current EA will not place any more primers as it is programmed to have only one primers at any one time. Also the primer lot size might have changed.

So, the best solution would be if we change the comment “Primer Buy” to “Normal Buy”. But since that wont be possible my solution would be to close the old primers in loss and reopen new primers (autosized).
So I am trying to figure out if there is any other way of tagging the orders instead of comment and Magicnumbers.

I used to have a setup where if DD was hit a second time primers would be added and channelXXX was reset regardless of what older primers existed before. That’s were the ignore primers where TP==Open idea came from initially. I am hoping though that if the new setup of primers are correct we’d never hit DD more than once in each direction as a return to primer area will mean ModifyXX will add new ones as needed, but I still set up two different main primer functions. OpenXXX for DD trigger and AddMainPendingXX for all other occasions. If we get the balance right the channel should never decrease in width, just expand with primers, but of course we need to be clever about when to change the borders.

Re
D

Just got confirmation from M that we could get DD below channelTop/above channelBottom even with the new primer split. I would think the easiest solution for this would be to “close” open primers on the current side of the grid by setting TP=Open (and deleting all pending) before starting up a new regime of primers calculated from the new border line. Shouldn’t add too much more complications, just a “reset” function called from OpenMainXXXPrimers().

Re
D

Guys,

Attached the first revision of EA with three types of primers.

I have explained the logic yesterday. test it out and let me know your opinions. The new parameters in this EA are:

  1. CheckN: The value for this variable is to be kept close to the TP of normal trades i.e set it at 45 if you have a TP of 50 pips. this is used to ensure that normal buys and stops are not placed too close to each other.
  2. useSecPrimer/usesubprimer - as the name suggests these are the secondary and sub primers.
    The lot sizes are auto calculated based on drawdown.
  3. Primerstep/secprimerstep/subprimerstep: steps for each type
  4. Tp values for each can be set.
  5. Lockin is availabe only for primer and sec primer.
  6. channeltop/bottom value is placed on drawdowns

Nothing much to explain. test it and let me know opinion.

The following logic is not yet implemented inthis version.

  1. Autolot size of normal trades
  2. Elimination of past primers if DD is caused below existing channeltop and above existing channelbottom.

the above two are important functions and i will add it in the next version.

I am drained from all the coding I have been doing the last 3 days.

Please test, analyse carefully and then advice.

Regards
CC

Greenland strategy with Mainsecondary and subprimers Rev0.zip (6.22 KB)

maybe i missed it, but what is your idea for this? if your thinking of closing them, would that not be a big loss, or is that just something i imagine? :slight_smile:

For eg. lets say sell primers are open at 1.4500
Price has retraced back some time ago, went up a long way, lot sizes have increased and now causes drawdown at 1.5000.
The EA is programmed currently such that it will not allow any more sell primers to open if a bunch is already open. Hence my suggestion is to just close the existing primers at loss and reopen new primers with correct lot sizes as required. this will cause a fall in balance but not equity.

So I got some info wrong before, secondary and sub-primers should not be replaced in case of retracements, only main primers (at secondary size) are replaced when retracements hits SL. This means that coding will be easier, but we need to check if these primers will be big enough to turn equity on smaller dips. My Excel sheets does not indicate that it will.

Also I’m still struggling to grasp the best way decide when to lower channelBottom. We’ll probably have to just test different scenarios to find a mathematical limit for this. M says that “if rate starts to range add regs, just look at patterns”, but that’s going to be a bear to do in code.

Re
D

Thx. for the new EA version. Will test and provide feedback.

Hi

Here is my test.

After about 6 months the channel stopped working and I started getting the following error:
EURUSD,M1: OrderSend error 148

It also seems there is still something wrong with the primer-sizing. The order error might be due to lack of equity for new primers, but I am not sure.

Anyway - here is my test. Hope others can look at it and try to identify issues / things that might be wrong.

I have loaded it right into MT4 without altering anything so assume default settings.
Strategy Tester_ Greenland strategy with Mainsecondary and subprimers Rev0.pdf (511 KB)

The EA had settings for 4 digits. U must input additional zero for all parameters if u r using a 5 digit broker n try again. I’m on mobile and can’t check ur attachment right now.

Hi Frawan,

Use the below settings and try again:
Lots=0.1; Risk=0.1; TP =500; Dist=100; U seSL=false; SL=0; S lip=30; CheckN =400; Check=100; UsePrimer=true; UseSecPrimer=true; UseSubPrimer=true;
UsePrimerSL=false; PrimerS L=2000; UseSecPrimerSL=false; SecPrimerSL=2000; UseSubPrimerSL=false; SubPrimerS L=2000; PrimerStep=800; SecPrimerS tep=500; SubPrimerStep=200; PrimerTP =3000; SecPrimerTP =1000; SubP rimerTP =200; PrimerLockin=300; SecPrimerLockin=100;
DrawDownAlert=60;

im looking forward to seeing a backtest with the auto increasing lot sizes, instead og static, as its hard to get a realistic Picture when its not increasing (so the old primers will get smaller than normal trades) :slight_smile:

I just figured out a nifty little trick. Put ManualChangesToVariables(); in you start() function and then add

void ManualChangesToVariables()
{
if(TimeCurrent() == StrToTime(“2008.08.12 12:29”))
{
MainPrimerDistance = 500;
msg = “2008.08.12 12:29 - Big fall, changing MainPrimerDistance to 50pips”;
}

if(TimeCurrent() == StrToTime(“2008.08.21 16:12”))
{
SetChannelBottom(1.88);
msg = “2008.08.21 16:12 - Starting to climb again, changing ChannelBottom to 1.8800, but keeping primer settings just in case”;
}

// ETC…
}

With this I can manually make changes to variables (this is GBP/USD from Jan 1st 2008 using my code) the way you would change external variables in a live run, but 3600 times the speed :slight_smile: I put the msg variable on the chart in a Comment() so I know where I am and then run visual BT. It’s helping me a lot in learning the actual system by running different scenarios. Of course you need to change the code, recompile and start up again for each thing you want to implement (which takes forevvvvvvvver), but I really think I’m learning and finding new things we need in the EA.

TimeCurrent() will use the tick date from you back test, so just find you favorite symbol and date and run it until you start asking yourself “what would happen if I changed x here”?

Re
D

ZeppDK: M referred to you for “technical questions”. Not sure if he meant programming or “system technical”. Have you used this system for an extended period of time on a channel of your own? If so, maybe you can help with some stuff.

MainPrimerDistance is obviously set depending on retracement patterns. I assume MainPrimerTakeProfit is extended for particular purposes/scenarios. What are they? How does MainPrimerDistance change Secondary-/ Sub-Primer?

If equity is falling too fast, I would guess that the preferred solution is to increase SubPrimerSize, but from 0.75 to what?

Do you know good rules for extending the regular trades into new areas? I’m running scenarios now where I change variables depending on what the rate does, and a huge failure so far is what do to when rate turns from a big drop (or rise). I have the tools in my EA to do lots of changes, but I don’t understand the system well enough to get past guesswork yet. Maybe I can run through different scenarios and post screenshots here and then we can discuss what “tools” to chose and why for each situation?

Re
D

no, i have not used primers yet in my own channel or my demo channel, i think M Means that he is not very computer-technical…
so im “translating” some of the EA related stuff we have talked about to “normal human language (and Danish)”, so that he knows a Little about what we are doing here…

i have read the same docs and replies as you have, and even though i can help a total noob grasp the idea and concept of the system, i dont think that i can be of much help with the fine art of the primers besides my personal point of view on Things, and help with testing, and i think that you made an awsome Excel showing primer placement, so you already have the pices… but what parameters the EA needs to look after for changing variables on the go, i have no clue… sorry :slight_smile:

My coding skills sux, and i dont have time to learn a new programming lang. right now, so cant help much with the code itself either :frowning:

Hmm, OK. Maybe WebZone is still around?

The thing is, in Excel you make some simple assumption like the rate will trigger a primer, move for 150 pips and then go back. I’m using 2008 as my test area since if I can make it through the “worst case scenario”, I’ll survive anywhere. As the cable falls 2000 pips in 2 weeks you quickly learn that having a paint brush doesn’t make you da Vinci. I can’t find any good info about when to do what and why. My EA is in no way perfect, but I can adjust variables for most things and it does most of the things I want it to, but I don’t have the skills yet.

If you change placement distance there will be positive and negative effects, same with sizing. Tried to ask M, but today was not a day for idle chatter I guess.

So far it’s easy: Chart GBPUSD, M1, 2013.06.07, Trading Point Of Financial Instruments Ltd, MetaTrader 4, Demo - MetaTrader Trading Platform Screenshots
Now it’s time to make informed choices: Chart GBPUSD, M1, 2013.06.07, Trading Point Of Financial Instruments Ltd, MetaTrader 4, Demo - MetaTrader Trading Platform Screenshots
Now I’m just guessing: Chart GBPUSD, M1, 2013.06.07, Trading Point Of Financial Instruments Ltd, MetaTrader 4, Demo - MetaTrader Trading Platform Screenshots
Manual interventions: Chart GBPUSD, M1, 2013.06.07, Trading Point Of Financial Instruments Ltd, MetaTrader 4, Demo - MetaTrader Trading Platform Screenshots
Stab in the dark: Chart GBPUSD, M1, 2013.06.07, Trading Point Of Financial Instruments Ltd, MetaTrader 4, Demo - MetaTrader Trading Platform Screenshots
How did I come to this: Chart GBPUSD, M1, 2013.06.07, Trading Point Of Financial Instruments Ltd, MetaTrader 4, Demo - MetaTrader Trading Platform Screenshots
I’m going to regret this: Chart GBPUSD, M1, 2013.06.07, Trading Point Of Financial Instruments Ltd, MetaTrader 4, Demo - MetaTrader Trading Platform Screenshots
Getting back to the safe area is going to kill me: Chart GBPUSD, M1, 2013.06.07, Trading Point Of Financial Instruments Ltd, MetaTrader 4, Demo - MetaTrader Trading Platform Screenshots
Ouch: Chart GBPUSD, M1, 2013.06.07, Trading Point Of Financial Instruments Ltd, MetaTrader 4, Demo - MetaTrader Trading Platform Screenshots

Re
D