PacMan (my first hybrid) - page 23

 
xxDavidxSxx:
I wrote it in but I get L_Lots variable not defined. I tried adding L_Lots=0; above and still told me not defined. Tried, double (L_Lots=0); too. Dave

you would need to declare it first

double L_Lots;

 
BluePearl:
you would need to declare it first double L_Lots;

cool thaks. Just had to drop the "=0" part.

Dave

 

Ok I got it working. But still just gives the individual orders lots size. It tells me the lots size of the open orders individually. I dunno.

Dave

 

i have change something at m4 platform? coz i always get lose (-ve)

 
daraknor:
The trailing stops I'm programming these days are price delayed. If the TP is 40, then we might wait until 30 to have a trailing stop of 10. Then, I like sliding the TP up when the SL moves up, so the average price will go higher. I keep the TP around in case of disconnects or strange 1 tick spikes. (Keep the brokers a little honest!) PContour also had the idea of making the TS contracting, to the broker limit. Some brokers allow as close as 5 pip SL from current price, why leave the extra pips on the table? Sometimes the strategy makes sense to exit near the peak instead of trying to wait out the countertrend.

So here is my ideal Trailing Stop:

Delayed = wait until X pips in profit

Tight = under 15 pip trailing stop

Contracting = move the SL closer and closer to current price as time goes on

Sliding = move TP up when SL is moved

Even without "Contracting" the average profit is usually higher than TakeProfit each trade, instead of lower as with normal Trailing Stops. Without "Sliding" the average profit *must* be lower than the TakeProfit.

Definitively worth implementing. However, my observation with using Goblin Bipolar is that quite often, right after TP, we still have a signal and a new order is opened. This results in a more grid like behaviour and avoids closing the trade on the countermove which gives back pips.

I see the advantages of sophisticated trailing strategies to allow additional pyramiding as soon as we sit on the right trend: When a trade is in guaranteed profit (by trailing beyound breakeven), we can simply forget about it and start new trades if we still have a signal. This is pyramiding ontop of successful trades without increasing risks. This is what I want to see from my early winners at levels 1-2.

 

Pacman with a twist

Dave - ever considered the concept of an Pacman EA with the following mods : link it to "another" indicator which basically says trend is UP or trend is DOWN. PACMAN only trades in this direction:

THIS IS THE DIFFERENCE THOUGH - as soon as the "other indicator" changes direction, all positions are closedand either:

a) position is opened in opposite direction starting with minimal no. lots (e.g. start of the sequence) or

b) starting with the same number of lots that have just been closed (e.g. if previous sequence was long 0.01, 0.02, 0.04, 0.08, 0.16 then open 0.16 in opposite direction).

What would you use as the "master indicator" to determine overall direction - maybe a simple Price_channel break based on last x number of bars?

Thanks

 
Toccata:
Dave - ever considered the concept of an Pacman EA with the following mods : link it to "another" indicator which basically says trend is UP or trend is DOWN. PACMAN only trades in this direction:

THIS IS THE DIFFERENCE THOUGH - as soon as the "other indicator" changes direction, all positions are closedand either:

a) position is opened in opposite direction starting with minimal no. lots (e.g. start of the sequence) or

b) starting with the same number of lots that have just been closed (e.g. if previous sequence was long 0.01, 0.02, 0.04, 0.08, 0.16 then open 0.16 in opposite direction).

What would you use as the "master indicator" to determine overall direction - maybe a simple Price_channel break based on last x number of bars?

Thanks

Indeed a good idea. Actually its already in MrsPacMan series. CCI is the primary signal. CCI buy and cci sell set to 55 peroid cci. above 0 trend/ momentom is up. Below 0 trend/momentom is down. And CCI block to block out overbought and over sold ranges when the market takes its turns the most. And mrspacmans signals are mostly ma's. The 55 ma will be the trend ma.

Right now I am working on a hedge stradigy that will use the amount of lots used in the open orders. starting at .1..+..2.+..4.+..8..+.16 thats 31. So the hedge needs to be at least 3.1 lots. Then I can test exiting stradigys for the hedging. Once I get the hedge thing down it will be safe for all pairs reguardless of volitility.

And I will get it there too.

keep the good suggestions coming

Dave

 

MathAbs

xxDavidxSxx:
Ok I got it now. Correction is in the zip file first post. There was a problem with woodies I guess. When I used the regular cci and took out 2 unnecessary lines it was fine.

You can set the cci buy/sell signals in the settings. Default is conservitive 160.

thanks For pointing that out to me.

Dave

This is my first visit to this thread and I do not know if this was answered so am answering.

MathAbs functions takes the absolute value of the parameter. If the value is negative it returns the positive value. So MathAbs(1) and MathAbs(-1) both return the value 1.

The way the code is shown your are taking the absolute value of 0 by using the following.

if (MathAbs(cci1 - cci1) / Point > 2.0)

if (MathAbs(jmav - jmav) / Point > 2.0)

cci1 - cci1 is 0 and jmav - jmav is also 0.

Perhaps you meant to use cci1 - cci2 and jmav1 - jmav2.

I still need to dowload the newest EA. Maybe this bug was already fixed.

Robert

 

Trailing stop

daraknor:
The trailing stops I'm programming these days are price delayed. If the TP is 40, then we might wait until 30 to have a trailing stop of 10. Then, I like sliding the TP up when the SL moves up, so the average price will go higher. I keep the TP around in case of disconnects or strange 1 tick spikes. (Keep the brokers a little honest!) PContour also had the idea of making the TS contracting, to the broker limit. Some brokers allow as close as 5 pip SL from current price, why leave the extra pips on the table? Sometimes the strategy makes sense to exit near the peak instead of trying to wait out the countertrend.

So here is my ideal Trailing Stop:

Delayed = wait until X pips in profit

Tight = under 15 pip trailing stop

Contracting = move the SL closer and closer to current price as time goes on

Sliding = move TP up when SL is moved

Even without "Contracting" the average profit is usually higher than TakeProfit each trade, instead of lower as with normal Trailing Stops. Without "Sliding" the average profit *must* be lower than the TakeProfit.

This idea sounds similar to my 3 level trailing stop. The code can be found in the DIN_KusKus_EA_v2.4. It can easily be modified to use more levels.

Basis idea.

Stoploss = 100

FirstMove = 20

When up 20 pips the stoploss is moved by the following value.

FirstStopLoss = 50 will move the stoploss to 50 pips above or below current price based on Buy or Sell trade.

SecondMove = 30

When up 30 pips the stoploss is moved by the following value.

SecondStopLoss = 30 moves stop to break even

ThirdMove = 40

When trade is up 40 pips the stoploss is moved pip by pip using the following value.

TrailingStop3 = 20 moves the stop to lock in 20 pips and trail by 20 pips from there.

All values are inputs.

Robert

 
MrPip:
This is my first visit to this thread and I do not know if this was answered so am answering.

MathAbs functions takes the absolute value of the parameter. If the value is negative it returns the positive value. So MathAbs(1) and MathAbs(-1) both return the value 1.

The way the code is shown your are taking the absolute value of 0 by using the following.

if (MathAbs(cci1 - cci1) / Point > 2.0)

if (MathAbs(jmav - jmav) / Point > 2.0)

cci1 - cci1 is 0 and jmav - jmav is also 0.

Perhaps you meant to use cci1 - cci2 and jmav1 - jmav2.

I still need to dowload the newest EA. Maybe this bug was already fixed.

Robert

Thanks MrPIP.

yea I figured that one out. Thanks for the detailed explanation.

The first post file is up to date. I am sure its not optimal and bug free but is working well on my accounts.

mrspacman is the better of the 2. They signal different. When one is trading, the other is usually sitting it out. This allows you to place both ea's on the same currancy pair, using one as I call (piggyback) with slightly less risk setting, and smaller t/p. And also you can set up a pacman account and mrspacman account and if one busts, chances are the other didn't.

Thats how I have the 2 accounts set up now. one started ballance at 3600 is at 3818 now. the other open for a week was 1300 now at 1374.

I have, with help, gotten the "adding total order lot size together" solved. Now I can work on affective hedging stradigy to make this safe for anything.

this should have everyone up to date on where I am at and where pacman series is.

Dave