a little help

Created at 31 Mar 2020, 14:30
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
LU

luca.tocchi

Joined 25.03.2020

a little help
31 Mar 2020, 14:30


Hi! after these instructions:

 int numberOfSymbolsChecked = 0;

            string EURUSD = Symbols[random.Next(Symbols.Count)];
            Symbols.GetSymbol("EURUSD");
            ExecuteMarketOrder(TradeType.Sell, EURUSD, Volume, "myLabel", StopLoss, TakeProfit);

            numberOfSymbolsChecked += 1;

 

how do I choose only one symbol and work only on that symbol?

example: a random symbol like EURCAD comes out, after this the program must work only on this symbol

thanks


@luca.tocchi
Replies

PanagiotisCharalampous
31 Mar 2020, 15:07

Hi luca,

You can keep the symbol in a variable. See below

 var symbol = Symbols.GetSymbol("EURUSD");

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

luca.tocchi
31 Mar 2020, 15:16

RE:

PanagiotisCharalampous said:

Hi luca,

You can keep the symbol in a variable. See below

 var symbol = Symbols.GetSymbol("EURUSD");

Best Regards,

Panagiotis 

Join us on Telegram

thanks a lot!


@luca.tocchi

luca.tocchi
31 Mar 2020, 19:04

RE:

PanagiotisCharalampous said:

Hi luca,

You can keep the symbol in a variable. See below

 var symbol = Symbols.GetSymbol("EURUSD");

Best Regards,

Panagiotis 

Join us on Telegram

I am writing here to not open a new question.

if I wanted to associate one or more indicators to the random asset how should I do it?

example: find a random asset for example eurusd. for example, I want to check the stochastic is uphill or downhill, But I would like to check it on the random asset (in this case EURUSD)

 

 if (_stochastic.PercentD.LastValue > _stochastic.PercentK.LastValue)
{

}

if I write like that, he checks the asset I play with

thanks


@luca.tocchi

PanagiotisCharalampous
02 Apr 2020, 08:29

Hi Luca,

Here is an example of how to get a stochastics oscillator for another symbol


            var symbol = Symbols.GetSymbol("EURUSD");
            var stochastic = Indicators.StochasticOscillator(MarketData.GetBars(TimeFrame, symbol.Name), 9, 3, 9, MovingAverageType.Simple);

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous