PanagiotisCharalampous's avatar
PanagiotisCharalampous
26 follower(s) 0 following 1006 subscription(s)
Replies

PanagiotisCharalampous
12 Aug 2020, 08:04

Hi ergun,

Leverage only affects the margin required for a position to open. Let's assume you have two accounts, one with balance $1000 and leverage 1:100 and one with balance $1000 and leverage 1:500. If you open a position of one lot (100000 volume) on both of them, on the 1:100 account you will use all your margin ($1000) while on the 1:500 account, you will only use $200. This means that on the 1:500 account you can open another four positions worth one lot. This is the actual use of leverage, to open positions of higher volumes. However positions with the same volume will have the same results on both. 

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
12 Aug 2020, 07:54

Hi Anders,

It is not possible to access an indicator on the chart through code. If you want to use indicators in your cBots, you need to declare them in the code. You can check the sample cBot shipped with cTrader and you will find a lot of examples on how to do this.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
12 Aug 2020, 07:49

Hi samuel.jus.cornelio,

Your code is wrong. Try the below

_Ema1.Result.HasCrossedBelow(_Ema2.Result, 0)

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
11 Aug 2020, 16:44

Hi Vamsi,

It seems that you are drawing arrows when the signal becomes bullish or bearish but you are not removing them when the signal becomes false

            if (IsBullish)
            {
                SignalIndex = index;
                DisplayArrows(index, "Buy");
                lastsignaltime = Bars.OpenTimes.Last(SignalIndex);
                signal = "Buy";
                SignalsData[index] = 1;
                SignalsIndexData[index] = index;
            }

            if (IsBearish)
            {
                SignalIndex = index;
                DisplayArrows(index, "Sell");
                lastsignaltime = Bars.OpenTimes.Last(SignalIndex);
                signal = "Sell";
                SignalsData[index] = 2;
                SignalsIndexData[index] = index;
            }

Try adding an else condition to remove the arrows and reset any relevant information.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
11 Aug 2020, 16:35

Hi samuel.jus.cornelio,

There are examples in the links above.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
11 Aug 2020, 16:30

Hi Sam,

It is not possible to know the entry price before the order is executed. To modify the stop loss price use ModifyStopLossPrice

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
11 Aug 2020, 15:41

Hi Sam,

Yes you are right, I misread the code. If the difference is slight then this is expected since you are calculating the stop loss distance based on the current price and not based on the position's entry price which might deviate due to slippage. If you need to place the stop loss on an exact price then you need to modify the position after it has been opened.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
11 Aug 2020, 15:15

Hi Vamsi,

Can you share the source code of this indicator?

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
11 Aug 2020, 10:53

Hi viesisz89,

This is already possible in cTrader 3.8.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
11 Aug 2020, 09:22

Hi tasr1r1,

Can you please check if a workspace is selected? Can you try changing workspaces and let us know if it becomes enabled?

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
11 Aug 2020, 08:07

Hi samuel.jus.cornelio,

You can use the HasCrossedAbove and HasCrossedBelow methods.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
11 Aug 2020, 08:01

Hi johanlo,

Can you please write your post in English?

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
11 Aug 2020, 07:54

Hi samuelbreezey,

Shouldn't you use totalPipsB instead of slPriceB here?

ExecuteMarketOrder(TradeType.Buy, SymbolName, exactVolumeB, InstanceName, slPriceB, tpPrice);

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
11 Aug 2020, 07:49

Hi koktos632,

It is not considered a bug. This is how it is designed to work. When more than one bars are created in one tick, then only one OnBar() event will be triggered. We will consider updating the documentation.  

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
11 Aug 2020, 07:46

Hi ergun,

You need to be more specific with the issue. Can you provide us with the indicator code that will allow us to reproduce this behavior?

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
11 Aug 2020, 07:44

Hi ergun,

I am not sure why do you expect different profits. Leverage has nothing to do with it. If you trade with the same volume, you will get the same results.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
11 Aug 2020, 07:42

Hi samuel.jus.cornelio,

You need to change your conditions accordingly e.g.

if (_Ema1.Result.LastValue > Symbol.Bid)

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
10 Aug 2020, 17:21

Hi samuel.jus.cornelio,

So you need to check if the price is above or below the EMA accordingly and not if it is equal.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
10 Aug 2020, 17:06

Hi samuel.jus.cornelio,

It is very rare the EMA to become equal to the price. You need to rethink your logic. Maybe your intentions are different to what you have written.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
10 Aug 2020, 15:07

RE:

Hi samuel.jus.cornelio,

See an example below

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewcBot : Robot
    {
        ExponentialMovingAverage _ema;
        protected override void OnStart()
        {
            _ema = Indicators.ExponentialMovingAverage(Bars.ClosePrices, 14);
        }


        protected override void OnTick()
        {

            if (_ema.Result.LastValue == Symbol.Bid)
            {
                // Execute trade
            }
        }

        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous