TradersYard Social Trading

GetSharingSourceForTY(Action<IEnumerable<ISocialChannel>, Exception> callback)

Description

This method is used to get the user TraderYard groups list where post can be shared. Can be used in OnInit() and OnCalculate()

Usage

GetSharingSourceForTY(Action<IEnumerable<ISocialChannel>, Exception> callback);

Parameter

callback - method which will be called when will get a list of the user group in ISocialChannel and if some error will arise Exception will contain an explanation.

Return Value none

Example

protected override void OnInit()
{
  GetSharingSourceForTY(GetChenalDes);
}

private void GetChenalDes(IEnumerable<ISocialChannel> channels, Exception exception)
{  
  if (exception == null)
  {
    foreach (var channel in channels)
      if (channel.DisplayName.Equals("My Account"))
        Log(string.Format("You can share post to {0}", channel.DisplayName),InfoLogLevel.Info);
  }
  else
  {
    Log(string.Format("You cant get TY channels list because: {0}", exception.Message), InfoLogLevel.Alert);
  }  
}

GetPost()

Description

This method is used to get post from the current chart. Which will contain a chart image and message with instrument and timeframe.

Usage

Parameter

none

Return Value SocialNetworkPost - post from the current chart which will contain chart image and message with instrument and timeframe.

Example

GetChartPostWithAnalytics

Description

This method is used to get post from the current chart with drawings. Which will contain a chart image(with displayed drawings) and a message with instrument and timeframe. This method also can throw “TradersYardException“ exceptions when chart doesn't have a drawing.

Usage

Parameter

none

Return Value SocialNetworkPost - post from the current chart which will contain chart image with drawings and message with instrument and timeframe.

Example

GetChartPostWithOrdersSetup

Description

This method is used to get post from the current chart with orders. Which will contain a chart image(include orders) and message with instrument and timeframe. This method also can throw “KeyNotFoundException“ exceptions when the chart doesn't have an open order.

Usage

Parameter

none

Return Value SocialNetworkPost - post from the current chart which will contain chart image with orders and message with instrument and timeframe.

Example

GetChartPostWithAtPlusPlusSetupTool

Description

This method is used to get post from the current chart with drawings. Which will contain a chart image(with displayed orders), a message with instrument and timeframe, and AT Analysis as attached file. This method also can throw “KeyNotFoundException“ exceptions when the chart doesn't have an open order or “TradingAtPlusPlusSetupSharedContent“ when ATpp not running currently.

Usage

Parameter

none

Return Value SocialNetworkPost - post from the current chart which will contain chart image with orders and message with instrument and timeframe.

Example

SharePostToTY(SocialNetworkPost post, ISocialChannel source)

Description

This method uses for sharing posts to TradersYard. For this method, there is a restriction that it can be performed no more than once every 0.5s. Otherwise, the OverflowException will be throw.

Usage

Parameter

post - a post to be published in TradersYard. One of the fields ImageFunc, Message, Document mast is set it is also possible to set all fields.

source - a group where post will be created. Can be empty if the field Channels of the post are set.

Return Value none

Example

Last updated