I am not sure I understand you, so sorry if this does not help.freakyg415 » Wed May 05, 2021 12:54 pm wrote:Many thanks Steve,
:youknow: I gave her a go and it worked like a charm. The error in the Experts tab reports that there is an "invalid lot amount for the send order function" and the alert below shows that the lot size is 0.0; that's when it hit me. I went under the hood to verify and I saw that the lot size is based off of the "Hard lot sizing" setting. Unless I am off in my logic.
Code: Select all
extern string hls="-- 'Hard' lot sizing --"; extern double Lot=0.1;The goal is to get the risk percent setting into the mix so that desky will take the desired risk percent, ATR period and multiplier, conduct the math to come up with the proper lot size and stop level, and enter the trade apropriately. In the manual it says that "You can use this feature (Differential Lot Sizing) in conjunction with account size lot sizing." I interpreted that to include the risk percentage I guess. Regardless I know this is possible but it looks like this is a bit more than a bolt change out under the hood , this baby needs a new set of headers to get where I'm trying to go. I'm a bit lost on how to calculate my desired effect but I'm in this for the long haul.Code: Select all
double lotSize = Lot;
Stay green gents.
V/r
Osito
Use the normalizeLots() function whenever you calculate a lot size. For example, sendBuyGrid() includes this code block:
Code: Select all
//Incremental lot sizing
if (UseIncrementalLotSizing)
if (!closeEnough(highestLotSoFar, 0))
{
lot = normalizeLots(symbol, highestLotSoFar + LotIncrement);
highestLotSoFar = lot;
}//if (!closeEnough(highestLotSoFar, 0))
Code: Select all
//Min/max checks
if ( lotSize < MarketInfo( symbol, MODE_MINLOT ) )
{
lotSize = MarketInfo( symbol, MODE_MINLOT );
}//if ( lotSize < MarketInfo( symbol, MODE_MINLOT ) )
if ( lotSize > MarketInfo( symbol, MODE_MAXLOT ) )
{
lotSize = MarketInfo( symbol, MODE_MAXLOT );
}//if ( lotSize > MarketInfo( symbol, MODE_MAXLOT ) )