WinningTrades [Report Graph Component]

How it was made

Preparation

Start NeedForTrade Studio.

Create daily IBM chart using OpenTick Delayed data provider (in this example 500 bars back from 04 Aug 2007 was loaded). See Creating Bar Chart.

Add BollingerBands_LE and BollingerBands_SE strategies to the newly created chart. We will need them to test our WinningTrades Report Graph Component. See Applying Strategy to a Chart.

Creation Steps

  • After preparation chart window with loaded data must be on the screen:

image

  • Select File->New->Report GraphComponent from application main menu. New Report Graph Component window will appear:

image 

  • Specify name for newly created analysis technique - WinningTrades1. To do that right-click on Report Graph Copmonent window and select Properties from context menu. In Properties window set Name property to WinningTrades:

image 

  • Write down (or copy-paste) the following code to the WinningTrades1 Report Graph Copmonent window:

    [code:c#]

    //we must process only closed RoundTrips
    int closed_round_trips_count;
    if ( RoundTrips[RoundTrips.Count-1].IsClosed)
    {
        closed_round_trips_count = RoundTrips.Count; /*all RoundTrips are closed*/
    }
    else
    {
        closed_round_trips_count = RoundTrips.Count - 1 /*skipping last opened RoundTrip*/;
    }
    //looping through each closed RoundTrip
    for (int i = 0; i < closed_round_trips_count; i++)
    {
        //we need to process only ROundTrips with positive profit
        if (RoundTrips[i].Profit > 0)
        {
            //adding new data point to WinningTrades chart:
            //x= i+1
            //y=profit of current RoundTrip
            AddDataPoint(i+1,RoundTrips[i].Profit);
        }
    }

    [/code]

  • After that we need to Build created analysis technique. To do that right-click on Report Graph Copmonent window and select Build Analysis Technique from context menu. If code was entered correctly, than build will not produce any errors. If not - Task List window will appear with errors list.
  • Now we need to test our WinningTrades Report Graph Component. Right-click on the Chart window created in Preparation steps. Select Strategy Performance Report from context menu. Strategy Performance Report window will appear. Select Trade Graphs tab from the tabs list at the top of the window:

image 

  • Click Add button to create new Trade Graph page (Preset).
  • Create Preset window will appear. Enter Preset NameWinning Trades 1 and press Create:

image

  • New Trade Graph preset will be created. Edit button will have red background indicating that current preset is editable:

image

  • Let's add our WinningTrades1 Report Graph Component to Trades Graph.
  • Open Browser window (if it's not already on the screen). To do that select View->Browser from application main menu.
  • Select Report Graph Component from Browse for list:

image

  • Drag-and-drop WinningTrades1 Report Graph Component from Browser window to Strategy Performance Report window's opened Trades Graph tab page.

image

  • No we need to format Winning Trades chart.
  • Double-click on the Winning Trades curve. Properties windows will appear:

image

  • Set Line|Color to Transparent (as we don't want to see WinningTrades curve - just points) by clicking on the Line|Color field and pressing image button. Then select Transparent from the Web list:

  image

  • Set Marker|Style to Square by clicking on the Marker|Style field and pressing image button. Then select Square from the list:

image

  • Set Marker|Size to 5.
  • Set Marker|Line Color to Lime.
  • Set Marker|Fill to Yes.
  • Set Marker|Fill Color to Lime.
  • Now Properties window will look like:

image

  • Winning Trades graph will look like:

image

  • Now we need to add Zero horizontal axis.
  • Open Browser window (if it's not already on the screen). To do that select View->Browser from application main menu.
  • Select Report Graph Component from Browse for list (if it's not already selected).
  • Drag-and-drop ReportZeroLine Report Graph Component from Browser window to Strategy Performance Report window's opened Trades Graph tab page:

image

  • To format ReportZeroLine double click it on the chart window. Properties windows will appear:
  • Set Line|Color to LightSlateGray.
  • Set Line|Line Width to 3.
  • WinningTrades Trade Graph preset is created an can be used later by selecting from the Select Preset list:

image

NeedForTrade Trading Platform
Home
Products
Features
Buy
Downloads
Support
Help
Tutorials
Contacts
Login
Login
Login