Definition

Override this method in your inherited class from DSTCreateModelBase to verify you would like to add the failed to reach profit target data set for training the machine learning model. A failed to reach profit target data set is one in which the price of the instrument failed to reach a long profit target or the trade was stopped out.

 

Note:  The DSTIsValidFailedLongDataSet method is called from the Deep Signal Library when creating a machine learning model. It is not used when trying to predict a machine learning model that has already been created. The Deep Signal Library will call the method to allow the user to either accept or reject a failed to reach profit target data set that would normally be used for training the machine learning model. When the Deep Signal Library finds a failed data set it would like to use in training the machine learning model, it will call DSTIsValidFailedLongDataSet for the failed data set. If the isValid parameter is set to true it will use the failed data set. If the isValid is set to false it will not use the failed data set.


The longSignalBarsBack parameter will tell the user how many bars back was the signal bar for a long trade. The signal bar Is the first bar of a series before the price hits the profit target in a predetermined amount of bars. The Bars To Target value represents the predetermined amount of bars needed to reach a long profit target.


 

Syntax

DSTIsValidFailedLongDataSet(int longSignalBarsBack, out bool isValid, bool stoppedOut, int barsBackStoppedOut)

 

Warning: If the user sets isValid equal to false then the failed data set will not be used in training the machine learning model. The default value of true will allow the failed data set to be used in training.

 

Parameters

longSignalBarsBack

An int used to pass the number of bars back that the signal bar had occurred.

isValid

bool value that must be assigned before leaving the method that determines whether to accept the failed long data set to be used in training a machine learning model

stoppedOut

bool value that is passed to let the user know that the trade was stopped out. The value will be true if the trade was stopped out.

barsBackStoppedOut

An int used to pass the number of bars back that the trade was stopped out if stoppedOut is true.  A value of -1 will be passed if the trade was not stopped out.


 

 

Examples

ns

Example of only allowing training for failed data sets in which the trade was stopped out within 3 bars of the current bar


public override void DSTIsValidFailedLongDataSet(int longSignalBarsBack, out bool isValid, bool stoppedOut, int barsBackStoppedOut)

{

       // Add your code here to verify you would like this data set used in training the machine learning model

       isValid = false;


       // Only add failed to reach data sets if the trade was stopped out and within 3 bars of the current bar

       if (stoppedOut && barsBackStoppedOut <= 3)

             isValid = true;

}



 

 









Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results.