Topics
16 Feb 2016, 07:16
 7267
 7
15 Aug 2015, 14:47
 5278
 15
28 Apr 2015, 14:20
 8115
 18
26 Feb 2015, 07:19
 3010
 2
23 Oct 2014, 13:52
 2337
 2
05 Sep 2014, 00:08
 0
 3179
 3
19 Aug 2014, 13:23
 2722
 3
Replies

hiba7rain
20 Aug 2015, 19:04

RE: RE: RE:

Hi Paul

thanks, i will download the latest update and ill do a search about HULL indicator to have more ideas :)

Paul_Hayes said:

hiba7rain said:

again i will say a big thanks to you and your interaction with me and other users i will reference your indicator to my cbot i just need more elaboration about IsBullish (IsRising) and IsBearish (IsFalling) :)

Paul_Hayes said:

hello again, I am sure you will work it out, you gave me an idea about the HULL average so i extended the original one to include signals:-

/algos/indicators/show/930

 

Download the latest indicator HMA Signals and the instructions on use with a cBot, read up on the HULL indicator as I mentioned before it will tell you how it is useful with trend.

 


@hiba7rain

hiba7rain
20 Aug 2015, 11:14

RE:

again i will say a big thanks to you and your interaction with me and other users i will reference your indicator to my cbot i just need more elaboration about IsBullish (IsRising) and IsBearish (IsFalling) :)

Paul_Hayes said:

hello again, I am sure you will work it out, you gave me an idea about the HULL average so i extended the original one to include signals:-

/algos/indicators/show/930

 


@hiba7rain

hiba7rain
20 Aug 2015, 10:09

RE:

Hi Paul,

thanks again for your support, actually the robot opens trades based on ADX indicator , and i wanted to use the HMA to exit from entries based on the cross of short and long period HMAs , so when i applied the  > or < i noticed that no trades created, i will apply  the function IsFalling or IsRising or might try to use different indicator that is more sensitive to price moves,  the good thing about HMA is the indicator reacts to price more than EMA or SMA 

Paul_Hayes said:

You probably already know this but, look at this extract about the Hull Average which is a trend indicator:-

A shorter period HMA may be used for entry signals in the direction of the prevailing trend. A long entry signal, when the prevailing trend is rising, occurs when the HMA turns up and a short entry signal, when the prevailing trend is falling, occurs when the HMA turns down.

So its common to use the property hull.hma.IsFalling() or hull.hma.IsRising(), I see you strategy compares 2 hull periods and closes positions depending on the period of the first indicator being higher or lower than the last indicator.

Your code snippet just closes any positions it finds, you are not opening any new positions, i recommend that you either:-

  1. Write the design of your strategy down in a document so that you have for example; a flow chart showing how it will work and then develop your code to match this.
  2. Post on the job board for someone to write this for you.

Cheers,

Paul.

 


@hiba7rain

hiba7rain
19 Aug 2015, 22:24

RE: RE:

        [Parameter("Hull Period", DefaultValue = 5, MinValue = 1)]
        public int HullPeriod { get; set; }

        [Parameter("Hull Period2", DefaultValue = 10, MinValue = 1)]
        public int HullPeriod2 { get; set; }

        private HMA hull;
        private HMA hull2;

    on start

            hull = Indicators.GetIndicator<HMA>(HullPeriod);
            hull2 = Indicators.GetIndicator<HMA>(HullPeriod2);

  on tick

            double _h = hull.hma.LastValue;
            double _h2 = hull2.hma.LastValue;

 

            if (_h < _h2)
            {
                var positionsToClose = Positions.FindAll(label, Symbol, TradeType.Buy);
                foreach (var position in positionsToClose)
                {
                    ClosePosition(position);

                }
            }

          if (_h > _h2)
            {
                var positionsToClose = Positions.FindAll(label, Symbol, TradeType.Sell);
                foreach (var position in positionsToClose)
                {
                    ClosePosition(position);

                }
            }

 

hiba7rain said:

hi , here is the codes below 

        [Parameter("Hull Period", DefaultValue = 5, MinValue = 1)]
        public int HullPeriod { get; set; }

        [Parameter("Hull Period2", DefaultValue = 10, MinValue = 1)]
        public int HullPeriod2 { get; set; }

on start 

 hull = Indicators.GetIndicator(HullPeriod);
            hull2 = Indicators.GetIndicator(HullPeriod2);

 

Paul_Hayes said:

hi,

without seeing the code its very hard to see where the problem may be

 

 


@hiba7rain

hiba7rain
19 Aug 2015, 22:17

RE:

hi , here is the codes below 

        [Parameter("Hull Period", DefaultValue = 5, MinValue = 1)]
        public int HullPeriod { get; set; }

        [Parameter("Hull Period2", DefaultValue = 10, MinValue = 1)]
        public int HullPeriod2 { get; set; }

on start 

 hull = Indicators.GetIndicator<HMA>(HullPeriod);
            hull2 = Indicators.GetIndicator<HMA>(HullPeriod2);

 

Paul_Hayes said:

hi,

without seeing the code its very hard to see where the problem may be

 


@hiba7rain

hiba7rain
19 Aug 2015, 21:42 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE:

hello Paul 

hope all fine, i have applied the same codes to my cbot but on test no trades made am not sure if am missing something :)

need your help/advise

  

Paul_Hayes said:

hiba7rain said:

Hi All, 

is it possible to show how to use the HMA (hull moving average) in Cbot code? i.e what will be the correct way to code it in cbot since the HMA is a custom indicator 

 

thanks

 

Hello,

Open your cbot, click on manage references and add the Hull indicator, if it is not showing then you will need to install it from the custom cbots by clicking on the cbot option in the menu above and search for the hull indicator.

Add a new user defined property:

[Parameter("Hull Period", DefaultValue = 5, MinValue = 1)]
public int HullPeriod { get; set; }

Add a new private variable: 

private HMA hull;
  1. In the onstart method add this:
// HULL moving Average
hull = Indicators.GetIndicator(HullPeriod);

Now you can use it to filter:

 // false signal to buy
 if (hull.hma.IsFalling())
 return 0;

 

 


@hiba7rain

hiba7rain
16 Aug 2015, 13:37

RE: RE:

Thanks Paul I really appreciate your help

my mistake was not defining the indicator int period on Getindicator method :)

Paul_Hayes said:

hiba7rain said:

Hi All, 

is it possible to show how to use the HMA (hull moving average) in Cbot code? i.e what will be the correct way to code it in cbot since the HMA is a custom indicator 

 

thanks

 

Hello,

Open your cbot, click on manage references and add the Hull indicator, if it is not showing then you will need to install it from the custom cbots by clicking on the cbot option in the menu above and search for the hull indicator.

Add a new user defined property:

[Parameter("Hull Period", DefaultValue = 5, MinValue = 1)]
public int HullPeriod { get; set; }

Add a new private variable: 

private HMA hull;
  1. In the onstart method add this:
// HULL moving Average
hull = Indicators.GetIndicator(HullPeriod);

Now you can use it to filter:

 // false signal to buy
 if (hull.hma.IsFalling())
 return 0;

 

 


@hiba7rain

hiba7rain
05 May 2015, 21:19

RE:

thanks again :)

so do you develop cbots and indicators ?

mindbreaker said:

i dont test it :) I dont have skype.

 


@hiba7rain

hiba7rain
04 May 2015, 21:48

RE: RE: RE: RE: RE: RE:

many thanks to you mindbreaker

it works with me except that the cbot stopped after 2 treads instead of 10 as set i dont know why :)

ill check it again 

do you have a skype ?

mindbreaker said:

and when stop:

        protected override void OnStop()
        {
            // Put your deinitialization logic here
            Print("Bot was stoped!");
        }

 

 


@hiba7rain

hiba7rain
04 May 2015, 16:17

RE:

?hiba7rain said:

Hi

Can any one help to show How to stop cBot after X number of trades or X number of profit pips?

 

thanks

 


@hiba7rain

hiba7rain
25 Feb 2015, 11:39

RE:

Thanks that will help but just want to know when we will have a function to read the trend lines (chart objects) values?

Spotware said:

First of all, you need to obtain MarketSeries object for TimeFrame.Hour using MarketData.GetSeries method.

Second of all, you need to create an indicator over the obtained series: Indicators.ExponentialMovingAverage(h1Series.Close, 30).

Hope this helps. If not, we can recommend you to contact one of our Partners or post a job in Development Jobs section.

 


@hiba7rain

hiba7rain
08 Feb 2015, 08:14

RE:

Thanks for any new updates but i just have a question, is the chart objects on both indicators and robots will have a readable value?

for example as trader if i draw a line that i see as a resistance or support line or a trend line it would be help full for me if i am able to use it to send me email notifications or even to trade the line (object) once the price hit the line, currently yes it is possible for placing the orders on same horizontal lines that we may draw but it is not possible for trend lines that we draw on charts hope you consider such function and make it available even without the need for us to create indicators or robots to use the new functions

thanks

cAlgo_Development said:

Three new methods will be introduced in ChartObjects object next release:

1. Generic line:

ChartObjects.DrawLine(objectName, date1, y1, date2, y2, color, [optional] thickness, [optional] style))
ChartObjects.DrawLine(objectName, index1, y1, index2, y2, color, [optional] thickness, [optional] style)

 

2. Horizontal line:

ChartObjects.DrawHorizontalLine(objectName, y, color, [optional] thickness, [optional] style)

 

3. Vertical line:

ChartObjects.DrawVerticalLine(objectName, date, color, [optional] thickness, [optional] style)
ChartObjects.DrawVerticalLine(objectName, index, color, [optional] thickness, [optional] style)


The logic of adding, updating and removing chart objects is the same as we already have in DrawText  method: objectName identifiers unique created object, if you draw second object with the same name, old one is removed (updated). So if you want to have e.g. several lines at the same time you have to use different object names.


All methods are available in both robots and indicators.


Here we will post several examples of usage.

 


@hiba7rain

hiba7rain
20 Oct 2014, 08:29

Hey all,

any suggestions?

 

thanks


@hiba7rain

hiba7rain
01 Sep 2014, 10:54

RE:

Thanks its fine on previous bar value , so if someone decide to go OnTick instead of OnBar the values would be accurate or still with some difference?

 

Spotware said:

OnBar event happens when new bar is opened. At that moment MarketSeries collection already contains tick from new bar. It means that last bar is not formed and in general cases open = high = low = close. If you want to access to last formed bar you need take previous one.

            Print("{0}", ema.Result.Last(1));

 

 


@hiba7rain

hiba7rain
01 Sep 2014, 10:06

RE:

sorry apologize for the typing mistake, the statement used to print the values is

protected override void OnBar()
        {

            var emaa = ema.Result.LastValue;
            Print("{0}", emaa);

I did check the indicators period several times and change both on the indicator and the Cbot statement but still I get a difference in values between actual indicator value and the printed value

Spotware said:

 

Please make sure that Periods of indicators are the same. Also, it is not clear how do you print values of indicator, because statement Print("{0}", ema) supposed to print name of indicator instead of its values.

 


@hiba7rain

hiba7rain
01 Sep 2014, 08:59 ( Updated at: 21 Dec 2023, 09:20 )

as below example


@hiba7rain

hiba7rain
19 Aug 2014, 15:35

RE:

Thanks I'll have a look at it

modarkat said:

Yes, there are plenty of collections in c#:

http://msdn.microsoft.com/en-us/library/ybcx56wz.aspx

 


@hiba7rain

hiba7rain
05 Aug 2014, 10:29

RE:

Thanks

I think the following link /forum/whats-new/2713 will be in addition to what you have provided will be a useful information for other users.

Thanks again

 

Spotware said:

You need to make sure that you use class name instead of indicator name. For instance, you need to use "SampleSMA" instead of "Sample SMA" in example shown there: /api/guides/indicators#el7

 


@hiba7rain

hiba7rain
01 Aug 2014, 17:18

RE: RE: RE: RE:

am trying to use custom indicator on my cbot as follows 

private HighestHigh_LowestLow _hl;

but am getting error says the type or namespace cannot be fond 

what possibly could be wrong?

hiba7rain said:

Thanks Spotware, 

gut i dont know why am getting the values of all last bars and not only the high and low of previous day ??

Spotware said:

Use MarketSeries. Method Last Access a value in the dataseries certain bars ago.

 

    var previouseDayHigh = MarketSeries.High.Last(1);
    var previouseDayLow = MarketSeries.Low.Last(1);

hiba7rain said:

 :) any suggestions 

hiba7rain said:

Hi All, 

am looking for your support, how can i get the higher high and lower low price for previous day?

Thanks 

 

 

 

 


@hiba7rain

hiba7rain
01 Aug 2014, 10:10

RE: RE: RE:

Thanks Spotware, 

gut i dont know why am getting the values of all last bars and not only the high and low of previous day ??

Spotware said:

Use MarketSeries. Method Last Access a value in the dataseries certain bars ago.

 

    var previouseDayHigh = MarketSeries.High.Last(1);
    var previouseDayLow = MarketSeries.Low.Last(1);

hiba7rain said:

 :) any suggestions 

hiba7rain said:

Hi All, 

am looking for your support, how can i get the higher high and lower low price for previous day?

Thanks 

 

 

 


@hiba7rain