Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ai
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
ai
Commits
44fbbc11
Commit
44fbbc11
authored
Jul 24, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pull
parent
550f5e60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
124 additions
and
8 deletions
+124
-8
grab2.js
grab2.js
+124
-8
No files found.
grab2.js
View file @
44fbbc11
...
@@ -156,6 +156,14 @@ function found(indicator,pair, lp) {
...
@@ -156,6 +156,14 @@ function found(indicator,pair, lp) {
let
d
=
res
[
i
].
split
(
'
,
'
)
let
d
=
res
[
i
].
split
(
'
,
'
)
let
timeframe
=
d
[
13
]
let
timeframe
=
d
[
13
]
timeframe
=
timeframe
.
split
(
'
'
)
let
newTimeframe
=
'
0d
'
for
(
let
z
=
1
;
z
<
timeframe
.
length
;
z
++
)
{
newTimeframe
=
newTimeframe
+
timeframe
[
z
]
if
(
z
!==
timeframe
.
length
-
1
)
newTimeframe
=
newTimeframe
+
'
'
}
if
(
indicator
===
2
)
if
(
indicator
===
2
)
return
{
timeframe
:
timeframe
,
nAtrPeriod
:
d
[
15
],
dAtrMultiplier
:
d
[
17
]}
return
{
timeframe
:
timeframe
,
nAtrPeriod
:
d
[
15
],
dAtrMultiplier
:
d
[
17
]}
...
@@ -163,14 +171,7 @@ function found(indicator,pair, lp) {
...
@@ -163,14 +171,7 @@ function found(indicator,pair, lp) {
return
{
timeframe
:
timeframe
,
nStochPeriod
:
d
[
15
],
nStochSmoothingPeriod
:
d
[
16
],
dOttPercent
:
d
[
18
]}
return
{
timeframe
:
timeframe
,
nStochPeriod
:
d
[
15
],
nStochSmoothingPeriod
:
d
[
16
],
dOttPercent
:
d
[
18
]}
if
(
indicator
===
4
)
if
(
indicator
===
4
)
return
{
timeframe
:
timeframe
,
nMidLnMaPeriod
:
d
[
14
],
dMultiplier
:
d
[
15
]}
return
{
timeframe
:
timeframe
,
nMidLnMaPeriod
:
d
[
14
],
dMultiplier
:
d
[
15
]}
// timeframe=timeframe.split(' ')
// let newTimeframe='0d '
// for (let z=1;z<timeframe.length;z++)
// {
// newTimeframe=newTimeframe+timeframe[z]
// if (z !== timeframe.length-1)
// newTimeframe=newTimeframe+' '
// }
// timeframe=newTimeframe
// timeframe=newTimeframe
// let nStochPeriod=parseFloat(d[15])
// let nStochPeriod=parseFloat(d[15])
// let nStochSmoothingPeriod=parseFloat(d[16])
// let nStochSmoothingPeriod=parseFloat(d[16])
...
@@ -185,3 +186,118 @@ function found(indicator,pair, lp) {
...
@@ -185,3 +186,118 @@ function found(indicator,pair, lp) {
}
}
let
indicator2Temp
=
'
yFt1_AlgName, yFt1_KivOzbPrfMaxi1a
\n
'
+
'
\n
'
+
'
; Note: See TradingView "Profit Maximizer PMax, Pine.txt"
\n
'
+
'
\n
'
+
'
; Symbol ==============================================================
\n
'
+
'
nQtSymNo_Tgt1, 1 ; #, In both TkSim and LiveRun
\n
'
+
'
\n
'
+
'
Sym1_Tgt1, BNC_BTCUSDT
\n
'
+
'
nDigits_Sym1_Tgt1, 3 ; #
\n
'
+
'
dTickValue_Sym1_Tgt1, 0.001 ; $
\n
'
+
'
dMarginValReqPerLot_Sym1_Tgt1, 10000 ; $
\n
'
+
'
\n
'
+
'
szOhlcCsvFpn_Sym1_Tgt1, "E:
\\
BTC.csv"
\n
'
+
'
stOhlcCsvFileBarAge_Sym1_Tgt1, 0d 00:05:00.000 ; Nd HH:mm:ss.fff, Typ. 28d 00:00:00.000
\n
'
+
'
enumOhlcCsvFileType_Sym1_Tgt1, TradingViewEpochSecondsOHLC
\n
'
+
'
bOhlcCsvFileHasHeader_Sym1_Tgt1, 1 ; 0 or 1, Def. 1
\n
'
+
'
\n
'
+
'
dOhlcCsvFileFromCandleTickExtractorFact_Sym1_Tgt1, 1.0 ; FpValue, Def. 1.0, Higher means extracting more ticks from each candle
\n
'
+
'
\n
'
+
'
; Tick Simulator Run Time =============================================
\n
'
+
'
dtTkSimLookBackStTime, 2022.03.01 00:00:00 ; YYYY.MM.DD HH:mm:ss
\n
'
+
'
dtTkSimReadStTime, 2022.03.01 00:00:00 ; YYYY.MM.DD HH:mm:ss
\n
'
+
'
dtTkSimReadEnTime, 2050.08.26 12:00:00 ; YYYY.MM.DD HH:mm:ss
\n
'
+
'
\n
'
+
'
; First quote is 2017.08.24 02:59:00
\n
'
+
'
\n
'
+
'
; StatInfo Parameters =================================================
\n
'
+
'
stMnRefHopAge, 0d 00:00:19.000 ; Nd HH:mm:ss.fff, Typ. 0d 00:00:19.000
\n
'
+
'
\n
'
+
'
; Signal Parameters ===================================================
\n
'
+
'
; Note: If use szOhlcCsvFpn_Sym1_Tgt1 then stMnMaBarAge will be adjusted based on CSV lines
\n
'
+
'
bForMnBarAge_ForceOhlcCsvFileBarsAge, 0 ; 0 or 1, Def. 1
\n
'
+
'
\n
'
+
'
; ParamLoop -----------------------------------------------------------
\n
'
+
'
stMnBarAge_List, 0d 00:05:00.000
\n
'
+
'
nAtrPeriod_List, 1 ; #, Def. 10 (ATR Length)
\n
'
+
'
dAtrMultiplier_List, 1.0 ; FpNum, Def. 3.0
\n
'
+
'
nMnMaPeriod_List, 1 ; #, Def. 10
\n
'
+
'
\n
'
+
'
bNormalizeAtr_List, 0 ; 0 or 1, Def. 0
\n
'
+
'
nEntSignalCodeNum_List, 1 ; #, 1: MaPmaxCx, 2: SrcPmaxCx, Def. 1
\n
'
+
'
enumMnMaType_List, EMA
\n
'
+
'
enumSrcType_List, HL2 ; "Open", "High", "Low", "Close", "HL2", "HLC3", "OHLC4"
\n
'
+
'
nAtrCalcMethodNum_List, 1 ; #, 1: use atr(period), 2: use sma(tr, period), Def. 1
\n
'
+
'
; bInverseEntSig_List, 0
\n
'
+
'
\n
'
+
'
; bOxyDisp_SrcVal, 0 ; 0 or 1, Def. 0
\n
'
+
'
; bOxyDisp_MnMaVal, 0 ; 0 or 1, Def. 0
\n
'
+
'
; bOxyDisp_MnTrailLines, 0 ; 0 or 1, Def. 0
\n
'
+
'
\n
'
+
'
; Trading Parameters ==================================================
\n
'
+
'
; Trading simulation start equity
\n
'
+
'
dTkSimStEquityUsd, 10000 ; $, Def. is $10,000 (Initial Capital)
\n
'
+
'
\n
'
+
'
nMnTrdMethodNum, 1 ; #, 0 to disable
\n
'
+
'
;nEntSignalCodeNum, 1 ; #, 1: MaPmaxCx, 2: SrcPmaxCx, Def. 1
\n
'
+
'
\n
'
+
'
; Trading Enter Param. ------------------------------------------------
\n
'
+
'
dFixedOrdLot_Sym1_Tgt1, 0.1 ; lot, Note: 0.1 lot here is equal to 10000 order size in trading view
\n
'
+
'
\n
'
+
'
;nMaxOneDirOrdNo, 1 ; #
\n
'
+
'
\n
'
+
'
;bInverseEntSig, 1
\n
'
+
'
\n
'
+
'
bWaitToPassFirstCrossToEnableEnt, 1 ; 0 or 1, Def. 1
\n
'
+
'
\n
'
+
'
; Trading Exit Param. -------------------------------------------------
\n
'
+
'
bClOppDirOrds, 1 ; 0 or 1, Def. is 0
\n
'
+
'
\n
'
+
'
bOkToOpenAndCloseChkAtSameQt, 1 ; 0 or 1, Def. 0
\n
'
+
'
\n
'
+
'
;nInitTpPip_Sym1_Tgt1, 200 ; pip
\n
'
+
'
;nInitSlPip_Sym1_Tgt1, 100 ; pip
\n
'
+
'
\n
'
+
'
; Log Parameters ======================================================
\n
'
+
'
bSaveOrdMgmResults, 1 ; 0 or 1, Def. 0, Save list of orders in a .csv file(s)
\n
'
+
'
bKeepPosHistOfTradeSim, 0 ; 0 or 1, Def. 1, Note: Set to 0 for ParamLoop runs
\n
'
+
'
\n
'
+
'
bWriteMktOrdsWhileRunning, 1 ; Write closed orders in a .csv file during yFt run and do not save them in system memory
\n
'
+
'
\n
'
+
'
bEnableBestTpSlFinderForPosHist, 0 ; 0 or 1, Def. 1, Set to 0 for fast output in ParamLoop runs
\n
'
+
'
\n
'
+
'
bSaveParamLoopRunResultsInCsv, 1 ; 0 or 1, Def. 0, Save ParamLoop run results in a .csv file
\n
'
+
'
\n
'
+
'
; Help: Full column list will be like as follows:
\n
'
+
'
;enumOrdSaveCsvColumn_List, RowNu,Open_Time,Type,Lots,Symbol,Open_Price,SL,TP,Close_Price,Close_Time,ProfitPips,ProfitUsd,Comment,MagicNum,Age_Dhhmmssfff,AgeMsec,TotPrfPips,TotPrfUsd,Open_Time_Ticks,Close_Time_Ticks,nAgeHiPrfPips,nAgeLoPrfPips,InvOpPrice,InvClPrice,Ticket,Expiration_Time,Expiration_Time_Ticks,Commission,Swap,nOmNum,nMyMagCode1,dPrfPipWrtOpPrPc,dAgeHiPrfUsd,dAgeLoPrfUsd,dAgeHiPrfInPrPc_RunUpPc,dAgeLoPrfInPrPc_DrawDownPc
\n
'
+
'
\n
'
+
'
; Help: Here is list of colums:
\n
'
+
'
; RowNum,Open_Time,Type,Lots,Symbol,Open_Price,SL,TP,Close_Price,Close_Time,ProfitPips,ProfitUsd,Comment,MagicNum,Age_Dhhmmssfff,AgeMsec,TotPrfPips,TotPrfUsd,Open_Time_Ticks,Close_Time_Ticks,nAgeHiPrfPips,nAgeLoPrfPips,InvOpPrice,InvClPrice,Ticket,Expiration_Time,Expiration_Time_Ticks,Commission,Swap,nOmNum,nMyMagCode1,dPrfPipWrtOpPrPc,dAgeHiPrfUsd,dAgeLoPrfUsd,dAgeHiPrfInPrPc_RunUpPc,dAgeLoPrfInPrPc_DrawDownPc
\n
'
+
'
; RowNum,Open_Time,Type,Lots,Symbol,Open_Price,SL,TP
\n
'
+
'
; ,Close_Price,Close_Time,ProfitPips,ProfitUsd,Comment,MagicNum,Age_Dhhmmssfff,AgeMsec
\n
'
+
'
; ,TotPrfPips,TotPrfUsd,Open_Time_Ticks,Close_Time_Ticks,nAgeHiPrfPips,nAgeLoPrfPips
\n
'
+
'
; ,InvOpPrice,InvClPrice,Ticket,Expiration_Time,Expiration_Time_Ticks,Commission,Swap
\n
'
+
'
; ,nOmNum,nMyMagCode1,dPrfPipWrtOpPrPc,dAgeHiPrfUsd,dAgeLoPrfUsd
\n
'
+
'
; ,dAgeHiPrfInPrPc_RunUpPc,dAgeLoPrfInPrPc_DrawDownPc
\n
'
+
'
\n
'
+
'
;enumOrdSaveCsvColumn_List, Ticket,Open_Time,Type,Lots,Symbol,Open_Price,Close_Price,Close_Time, ProfitPips,dAgeHiPrfInPrPc_RunUpPc,dAgeLoPrfInPrPc_DrawDownPc
\n
'
+
'
enumOrdSaveCsvColumn_List, Ticket,Open_Time,Type,Symbol,Open_Price,Close_Price,Close_Time, dPrfPipWrtOpPrPc,dAgeHiPrfInPrPc_RunUpPc,dAgeLoPrfInPrPc_DrawDownPc
\n
'
+
'
\t\t\t\t\n
'
+
'
; Display Parameters ==================================================
\n
'
+
'
; nOxyDispQtsQueLen, 0 ; #, Typ.: 1/5 of screen width
\n
'
+
'
\n
'
+
'
; bOxypDisp_ForceOhlcCsvFileBarsAge, 0 ; 0 or 1, Def. 1
\n
'
+
'
;OxypDispBarsAgeSym1, 0d 01:00:00.000 ; Nd HH:mm:ss.fff
\n
'
+
'
\n
'
+
'
; bOxyDisp_Equity, 0 ; 0 or 1, Def. 0
\n
'
+
'
; bOxyDisp_Balance, 0 ; 0 or 1, Def. 0
\n
'
+
'
; bOxyDisp_EffLot, 1 ; 0 or 1, Def. 0
\n
'
+
'
\n
'
+
'
;adOxyDisp_FirstYaxisSplitPos, 0.3, 0.4 ; CSV List of #
\n
'
+
'
;bOxyDisp_AutoSplitPosInFirstYaxis, 1 ; 0 or 1, Def. is 1
\n
'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment