Topics
07 Jul 2016, 10:34
 0
 2249
 1
30 Sep 2014, 20:58
 3039
 1
23 Jan 2014, 21:43
 3655
 4
15 Jan 2014, 12:39
 4922
 3
09 Jan 2014, 15:15
 2731
 3
09 Jan 2014, 10:45
 0
 2575
 2
05 Jan 2014, 12:17
 3493
 6
04 Jan 2014, 19:43
 5641
 11
27 Dec 2013, 22:20
 4572
 10
27 Dec 2013, 16:51
 2631
 4
22 Dec 2013, 22:13
 3285
 5
19 Dec 2013, 09:50
 0
 2975
 2
19 Dec 2013, 09:16
 3056
 2
17 Dec 2013, 13:26
 0
 2558
 2
15 Dec 2013, 23:21
 3083
 2
13 Dec 2013, 13:23
 2870
 1
12 Dec 2013, 13:47
 2402
 2
10 Dec 2013, 19:53
 4484
 12
09 Dec 2013, 21:06
 2388
 3
Replies

jeex
07 Jul 2016, 13:05

No more ticks yet?

In the youtube video http://youtu.be/4tlOf_feeB4 , we see higher amounts of ticks. This would make cTrader interesting again.


@jeex

jeex
24 Jan 2014, 00:30

RE:

modarkat said:

you can try https://www.myfxbook.com/

That is not what i meant. Just publish the data of one trade.

There is off course the possibility of making a MySQL connection, but i would like it much simpler than that. After all, all trades are also visible in cWeb.

Maybe the guys 'n girls from Spotware have an idea?


@jeex

jeex
18 Jan 2014, 20:37

RE: RE: RE: RE: RE: Delta

MRSV said:

I think jeex is right. I think the dream robot for me would be the one you describe jeex. And when it got to step 2 you would get a image of the chart a option to take the trade or not on you phone. Only problemis that you can't trade when you sleep :/

That's the beauty of trading: within 18 months of saving all your profits and thus compounding balance, you can make enough profits in a day, to sleep for the rest of the week.

And until that goal is reached, trading 4 hours a day, 4 days a week (mon-thu) 40 weeks a year next to a part time job will be rewarded! Keep that up for about 18 months without making withdrawals and with a fixed balance percentage of 3% to calculate lot volume, and you will become a millionaire.

Guys: discipline is the key to success. Discipline in money management as well in trading strategy. Only make trades that are 100% according to the strategy, and filter out the bad trades by getting a good feel for the waves.

Charts are like stochastic music: listen long enough and you will absolutely hear the harmony and feel the rhythm.


@jeex

jeex
18 Jan 2014, 13:05

BE

I think after closing half the position you still need to set SL to BE:

private double calcBE(Position p)
 {
            double totalCosts = Symbol.Spread + ((position.GrossProfit - position.NetProfit) / position.Volume / Symbol.PipValue);
            if (p.TradeType == TradeType.Buy)
                return p.EntryPrice + totalCosts;
            else
                return p.EntryPrice - totalCosts;
}

and then modify the position with the calculated new SL of calcBE()


@jeex

jeex
17 Jan 2014, 18:49

RE: RE: Delta

oktrader said:

jeex said:

2. This is my job: making the right decision.

 

Hi Jeex,

I've been thinking about what have you said here. Don't you think that at  last you could code step 2? 

If you really follow a strong strategy and your free decisions aren't martingale based, you have to be able to code them. If you always consider the same patterns for "making the right decision", it's just a matter of time to finally code them.

Otherwise, if you can't code them, it means that your "decision" is more martingale based than you thought.

Nope. Robots cannot make decisions. Unless you want to lose money of course. The best robot i've seen so far with the best results, was one that opened trades fully and completely at random and had TP = SL * 4. So no robots for me. At least not when you want to double your balance every month.


@jeex

jeex
17 Jan 2014, 18:47

SL and TP

When opening the trade, i decide the maximum loss in pips, or by appointing one of the lines in the Ichimoku: Tenkan Sen, Kijun Sen or the max or min of Senkou Span A or B. The robot calculates SL and calculates the lot size, as that is my max risk.

The same way i can appoint one of these lines as TP, or i appoint a fixed TP and let the bot close half of the trade at that point, set SL to BE for the remaining half and let the bot trail the rest by modifying the TP to the appointed Ichimoku line level. The bot can repeat that scheme and half the remaining trade again. Usually the first profit + BE is taken at a fixed pip rate = fixed SL rate, then the second is taken at  crossing the Tenkan Sen, and often the third at crossing the Kijun Sen.

So i use Ichimoku to determine SL and TP, and a bit for determining the trade.


@jeex

jeex
17 Jan 2014, 13:54

Delta

Same aproach, different solution...

I use three bots for that.

  1. The first bot monitors all relevant pairs on specific criteria (like strong trend or strong reversal). This is where my TFV comes in handy.
  2. This is my job: making the right decision.
  3. A second bot calculates the volume and SL & TP and openes a trade.
  4. A third bot trails the trade, partially closes it, if relevant, all by modifying the SL and TP.
  5. The server closes the trade on the SL or TP. So no harm done if internet fails or the computer goes down.

This way psycho-actions :-) are mostly avoided. I do not have to stare in screens all day; only when my alert tells me to.

Finally it's my personal skills that decide on opening a trade. So no need of martingale calculations as my winning percentage is almost at 80 of the trades (and going up), where as my TP is always higher than my SL. The software does all the tedious work, i only surf the waves of the charts.


@jeex

jeex
17 Jan 2014, 09:12

Martingale

On Tick still works of course. I use my Indicator Temporary Fair Value to make sure that a single tick does not start a trade, if that price is not supported by more action.

I looks like you use a martingale construction in your robot. Isn't that an unnecessary risk?

Good luck with it. Keep us posted with more results please.


@jeex

jeex
16 Jan 2014, 09:08

no indicator needed

cAlgo has no Heiken Ashi, while the cWeb does. So you would need to add an external indicator that makes HA and add a reference.

Easier is to just calculate the HA-values and determine if Up or Down:

  • xClose = (Open+High+Low+Close)/4
    o Average price of the current bar
     
  • xOpen = [xOpen(Previous Bar) + Close(Previous Bar)]/2
    o Midpoint of the previous bar
     
  • xHigh = Max(High, xOpen, xClose)
    o Highest value in the set
     
  • xLow = Min(Low, xOpen, xClose)
    o Lowest value in the set

You can calculate that with two functions.

        private double haClose(int bar)
        {
            return (MarketSeries.Open[bar] + MarketSeries.Low[bar] + MarketSeries.Close[bar] + MarketSeries.High[bar]) / 4.0;
        }
        private double haOpen(int bar)
        {
            if (bar < 1)
                return MarketSeries.Median[bar];
            else
                return (haOpen(bar - 1) + MarketSeries.Close[bar - 1]) / 2.0;
        }

And then in the calculate() method simply

            double hopen = haOpen(index);
            double hclose = haClose(index);

            if (hopen < hclose)
            {
                // TREND UP
            }
            else
            {
                // TREND DOWN
            }

Now i'm sure that in return you will share your winning strategy with us on this forum ;-)


@jeex

jeex
15 Jan 2014, 19:32

Idea

Putting it in a seperate indicator panel is easy. Change true in line 16 to false.

How to make this panel time-independent, i don't know. Next version of this indicator will have the possibility to maken the block size relative to ATR.


@jeex

jeex
09 Jan 2014, 16:15

Great, thanks Hichem. Now i only have to find out how i can send all messages from diferent charts to this one mesaage window in stead of opening a number of message windows.
@jeex

jeex
08 Jan 2014, 12:18

I'm awfully sorry for my ignorance. I've only been in the software development business for 29 years, but never worked with Microsoft Visual or C.


@jeex

jeex
08 Jan 2014, 10:26

RE: Parallels

Cerunnos said:

Can it be that cAlgo together with Parallels (Windows 7 & Mac) makes Problems? The fan of my MacBook Pro (i5 CPU + 8MB RAM) is extremely loud after the start of cAlgo. A normal work is almost impossible ...

I work with a MacPro with 8 double processors, Parallels Windows 7 (4Gb mem and 4 processors assigned to this VM) and this gives the same memory isues as my Windows 8 Asus laptop.


@jeex

jeex
07 Jan 2014, 16:56

less

That is good news as this point almost drives me back to MT4. Will it be less memory consuming also, or is that impossible?


@jeex

jeex
07 Jan 2014, 16:55

t

aTrader: that's exactly my point.

It's absolutely absurd that r = 0, while r is a double. If i want r to be have the value that suits a double, i have to typecast both numerator and denominator.

double r = (double)x / (double) y; 

I do not know of one language that does not use / as a simple devider with a double as result, but makes it as ambiguous as c#.


@jeex

jeex
06 Jan 2014, 19:19

Looking n periods back
int nBack = ...;

double nClose = MarketSeries.Close.Last(nBack);

.Last is the most convenient way of looking n timeframes back.
 


@jeex

jeex
05 Jan 2014, 20:50 ( Updated at: 21 Dec 2023, 09:20 )

Something like this?
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC)]
    public class SMAchannel : Indicator
    {
        [Parameter("Periods", DefaultValue = 20, MinValue = 1, MaxValue = 500)]
        public int _Periods { get; set; }

        [Parameter("Distance Top (pips)", DefaultValue = 20, MinValue = 1, MaxValue = 1000)]
        public int _dTop { get; set; }

        [Parameter("Distance Bottom (pips)", DefaultValue = 20, MinValue = 1, MaxValue = 1000)]
        public int _dBottom { get; set; }

        [Output("SMA", Color = Colors.Purple, PlotType = PlotType.Line, Thickness = 1)]
        public IndicatorDataSeries SMA { get; set; }

        [Output("dTop", Color = Colors.DodgerBlue, PlotType = PlotType.Line, Thickness = 1)]
        public IndicatorDataSeries dTop { get; set; }

        [Output("dBottom", Color = Colors.Tomato, PlotType = PlotType.Line, Thickness = 1)]
        public IndicatorDataSeries dBottom { get; set; }

        private SimpleMovingAverage _sma;

        protected override void Initialize()
        {
            _sma = Indicators.SimpleMovingAverage(MarketSeries.Close, _Periods);
        }

        public override void Calculate(int index)
        {
            SMA[index] = _sma.Result[index];
            dTop[index] = _sma.Result[index] + pip2dif(_dTop);

            dBottom[index] = _sma.Result[index] - pip2dif(_dBottom);
        }

        private double pip2dif(int pip)
        {
            return pip * Symbol.PipSize;
        }
    }
}

You set the distance in pips. See example below.


@jeex

jeex
05 Jan 2014, 12:21

Alzheimer sure flies low this winter

Cerunnos, that's why i called in some help.

Somehow my math brain becomes blind for simple calculations. I'm completely lost. Maybe a short vacation will help.

double totalCosts = Symbol.Spread + (((position.GrossProfit - position.NetProfit) / position.Volume / Symbol.PipValue)*2);

 


@jeex

jeex
04 Jan 2014, 23:50

RE: RE: Simple

Cerunnos said:

Your code includes commission only one way. Or not?

Yep, my mistake: should include them both ways, thanks for the reminder:

 private double calcBE(Position p)
 {
            double totalCosts = Symbol.Spread + ((p.GrossProfit - p.NetProfit) * 2);
            if (p.TradeType == TradeType.Buy)
                return p.EntryPrice + totalCosts;
            else
                return p.EntryPrice - totalCosts;
}

 


@jeex