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

PanagiotisCharalampous
04 Aug 2020, 11:13

Hi fang0092,

There is not enough data loaded in your m1 bars. You need to load more history to obtain the data. See below

                    while (m1Bars.OpenTimes.GetIndexByTime(Rect1.Time1) < 0)
                        m1Bars.LoadMoreHistory();
                    var PRICE = m1Bars.HighPrices[m1Bars.OpenTimes.GetIndexByTime(Rect1.Time1) + i];
                    Print("for statement: price_tobreak is " + price_tobreak + " while high for this time is" + PRICE);
                    while (m1Bars.OpenTimes.GetIndexByTime(Rect1.Time1) < 0)
                        m1Bars.LoadMoreHistory();
                    var PRICE = m1Bars.LowPrices[m1Bars.OpenTimes.GetIndexByTime(Rect1.Time1) + i];
                    Print("for: price_tobreak is " + price_tobreak + " while low for this time is" + PRICE);

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
04 Aug 2020, 10:30

Hi Vamsi,

I cannot build this indicator. Can you please provide the actual working indicator and cBot?

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
04 Aug 2020, 10:27

Hi fang0092,

Please provide the complete code so that we can reproduce the behavior.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
04 Aug 2020, 08:25

Hi namth0712,

The balance is available in ProtoOATrader.balance. The P&L of each position needs to be calculated using the position's entry price and the current symbol bid/ask price.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
04 Aug 2020, 08:22

Hi vamsi.rc,

Can you please send us some troubleshooting information (Ctrl+Alt+Shift+T) and paste the link to this discussion in the description?

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
04 Aug 2020, 08:18

Hi kostya.bartchenkov,

No this is not possible at the moment.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
04 Aug 2020, 08:17

Hi samuel.jus.cornelio,

Here is an example 

           var rsi1 = Indicators.RelativeStrengthIndex(Bars.ClosePrices,14);
           var rsi2 = Indicators.RelativeStrengthIndex(Bars.ClosePrices,15);
           var rsi3 = Indicators.RelativeStrengthIndex(Bars.ClosePrices,16);
           var rsi4 = Indicators.RelativeStrengthIndex(Bars.ClosePrices,17);

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
04 Aug 2020, 08:14

Hi alexnikon,

Thanks for the additional information but the screenshot does not explain what is the problem with higher timeframes. Can you elaborate? What does it do and what should it do instead?

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
04 Aug 2020, 08:10

Hi puppiebullet1,

Your code does not check for crossovers but if the price is above or below the SMA. Hence it will open trades on every tick. Try adding a condition that will check if positions are already open in that direction before placing a new one.

 Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
03 Aug 2020, 16:09

Hi Bjorn,

1) The Last() method used in this example is this one.

2) You can use index to access indicator values from the cBot e.g. S2.B[index], but is more complicated to get the correct value than using Last() method.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
03 Aug 2020, 15:45

Hi alexnikon,

I cannot help you further at the moment because I have no idea what is the indicator expected to do. You need to provide more information of what the expected outcome should be and what does the indicator do instead. Screenshots would be helpful.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
03 Aug 2020, 15:19

Hi Bjorn,

You try something like this

  if (!double.IsNaN(S2.B.Last(1)))

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
03 Aug 2020, 15:04

Hi alexnikon,

I am not sure what is the indicator supposed to do but your indexing is definitely wrong. See below how to get the correct indices for your indicators


            double smaHigh = _smaHigh.Result[_bars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]) - 0];
            double smaHighPrev = _smaHigh.Result[_bars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]) - 1];
            double smaLow = _smaLow.Result[_bars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]) - 0];
            double smaLowPrev = _smaLow.Result[_bars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]) - 1];

Let me know if this helps

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
03 Aug 2020, 14:19

Hi Bjorn,

Your questions are not very clear unfortunately. If you are just trying to check the DataSeries values, you can use Last() method and check if the value is NaN or not.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
03 Aug 2020, 14:15

Hi puppiebullet1,

You can use Symbol.Bid in the HasCrossedAbove function to check this.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
03 Aug 2020, 14:12

Hi keyyuki,

This information is not available in historical data.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
03 Aug 2020, 12:56

Hi puppiebullet1,

See the documentation for both methods below

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
03 Aug 2020, 12:24

Hi Bjorn,

Try checking the B output value instead of using the SIGNAL variable. What you are doing is not a good programming practice.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
03 Aug 2020, 11:57

Hi Bjorn,

The cBot and indicator do exactly what you programmed them to do. You need to fix your logic. For example

 if (high > 0)
            {
                SIGNAL = 1;
                B[index] = Bars.HighPrices[index];
            }

            else
            {
                SIGNAL = 0;
            }

Here you set the B value when there is a signal but not when there isn't. Why? This will cause B having a value and displaying a point while SIGNAL is 0.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
03 Aug 2020, 11:18

Hi ricckytrading,

No, nobody has access to the source code.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous