Update genetic front
This commit is contained in:
@@ -674,6 +674,16 @@ public class TradingBotChromosome : ChromosomeBase
|
|||||||
scenario.AddIndicator(indicator);
|
scenario.AddIndicator(indicator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var mm = new MoneyManagement
|
||||||
|
{
|
||||||
|
Name = $"Genetic_{request.RequestId}_MM",
|
||||||
|
Timeframe = request.Timeframe,
|
||||||
|
StopLoss = Convert.ToDecimal(stopLoss),
|
||||||
|
TakeProfit = Convert.ToDecimal(takeProfit),
|
||||||
|
Leverage = 1.0m
|
||||||
|
};
|
||||||
|
mm.FormatPercentage();
|
||||||
|
|
||||||
return new TradingBotConfig
|
return new TradingBotConfig
|
||||||
{
|
{
|
||||||
Name = $"Genetic_{request.RequestId}",
|
Name = $"Genetic_{request.RequestId}",
|
||||||
@@ -694,14 +704,7 @@ public class TradingBotChromosome : ChromosomeBase
|
|||||||
UseForSignalFiltering = false,
|
UseForSignalFiltering = false,
|
||||||
UseForDynamicStopLoss = false,
|
UseForDynamicStopLoss = false,
|
||||||
Scenario = scenario,
|
Scenario = scenario,
|
||||||
MoneyManagement = new MoneyManagement
|
MoneyManagement = mm,
|
||||||
{
|
|
||||||
Name = $"Genetic_{request.RequestId}_MM",
|
|
||||||
Timeframe = request.Timeframe,
|
|
||||||
StopLoss = Convert.ToDecimal(stopLoss),
|
|
||||||
TakeProfit = Convert.ToDecimal(takeProfit),
|
|
||||||
Leverage = 1.0m
|
|
||||||
},
|
|
||||||
RiskManagement = new RiskManagement
|
RiskManagement = new RiskManagement
|
||||||
{
|
{
|
||||||
RiskTolerance = RiskToleranceLevel.Moderate
|
RiskTolerance = RiskToleranceLevel.Moderate
|
||||||
|
|||||||
@@ -10,27 +10,42 @@ const Modal: React.FC<IModalProps> = ({
|
|||||||
onClose,
|
onClose,
|
||||||
titleHeader,
|
titleHeader,
|
||||||
children,
|
children,
|
||||||
|
size = '4xl',
|
||||||
}) => {
|
}) => {
|
||||||
|
const getSizeClass = (size: string) => {
|
||||||
|
switch (size) {
|
||||||
|
case 'sm':
|
||||||
|
return '!max-w-sm'
|
||||||
|
case 'md':
|
||||||
|
return '!max-w-md'
|
||||||
|
case 'lg':
|
||||||
|
return '!max-w-lg'
|
||||||
|
case 'xl':
|
||||||
|
return '!max-w-xl'
|
||||||
|
case '2xl':
|
||||||
|
return '!max-w-2xl'
|
||||||
|
case '3xl':
|
||||||
|
return '!max-w-3xl'
|
||||||
|
case '4xl':
|
||||||
|
return '!max-w-4xl'
|
||||||
|
case '5xl':
|
||||||
|
return '!max-w-5xl'
|
||||||
|
case '6xl':
|
||||||
|
return '!max-w-6xl'
|
||||||
|
case '7xl':
|
||||||
|
return '!max-w-7xl'
|
||||||
|
default:
|
||||||
|
return '!max-w-4xl'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!showModal) return null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto">
|
<>
|
||||||
{showModal ? (
|
{onSubmit ? (
|
||||||
onSubmit ? (
|
<form onSubmit={onSubmit}>
|
||||||
<form onSubmit={onSubmit}>
|
<div className="modal modal-open">
|
||||||
<div className="modal modal-bottom sm:modal-middle modal-open">
|
<div className={`modal-box ${getSizeClass(size)} w-11/12`}>
|
||||||
<div className="modal-box !max-w-4xl !w-11/12">
|
|
||||||
<ModalHeader
|
|
||||||
titleHeader={titleHeader}
|
|
||||||
onClose={onClose}
|
|
||||||
onSubmit={onSubmit}
|
|
||||||
showModal={showModal}
|
|
||||||
/>
|
|
||||||
{children}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
) : (
|
|
||||||
<div className="modal modal-bottom sm:modal-middle modal-open">
|
|
||||||
<div className="modal-box !max-w-4xl !w-11/12">
|
|
||||||
<ModalHeader
|
<ModalHeader
|
||||||
titleHeader={titleHeader}
|
titleHeader={titleHeader}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
@@ -40,9 +55,21 @@ const Modal: React.FC<IModalProps> = ({
|
|||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
</form>
|
||||||
) : null}
|
) : (
|
||||||
</div>
|
<div className="modal modal-open">
|
||||||
|
<div className={`modal-box ${getSizeClass(size)} w-11/12`}>
|
||||||
|
<ModalHeader
|
||||||
|
titleHeader={titleHeader}
|
||||||
|
onClose={onClose}
|
||||||
|
onSubmit={onSubmit}
|
||||||
|
showModal={showModal}
|
||||||
|
/>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ export type IModalProps = {
|
|||||||
children?: React.ReactNode
|
children?: React.ReactNode
|
||||||
toggleModal?: React.MouseEventHandler<HTMLButtonElement>
|
toggleModal?: React.MouseEventHandler<HTMLButtonElement>
|
||||||
moneyManagement?: MoneyManagement
|
moneyManagement?: MoneyManagement
|
||||||
|
size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl'
|
||||||
}
|
}
|
||||||
|
|
||||||
export type IMoneyManagementModalProps = {
|
export type IMoneyManagementModalProps = {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user