Candle Index
Forums › ProRealTime English forum › ProOrder support › Candle Index
- This topic has 5 replies, 2 voices, and was last updated 8 years ago by MDS.
Viewing 6 posts - 1 through 6 (of 6 total)
-
-
11/24/2016 at 3:11 PM #17109
Hi All,
I’m trying to develope a TS.
The TS enter at market when 3 conditions are accomplished.
I need to know ho to get the index of a bar, because when a condition occurs, the other maybe not and I’d like to define a window of validity.
Anyway I want a condition is valid for N candles.
I tried to get the barindex and store into a variable… but this values follows the evolution of barindex
How to can I achieve that?
Best Regards,
Mauro
11/24/2016 at 3:39 PM #1711311/24/2016 at 4:34 PM #17118Thanks, if needed I’ll translate in english. The conditions have to be valid for N candles
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859once divergenzaLongCondizione = 0once divergenzaShortCondizione = 0once divergenzaConditionIndex = 0divergenzaSeniority = window*1.1if (pHigh[window] - Chikou)*pipfactor>soglia thendivergenzaLongCondizione = 1divergenzaConditionIndex = divergenzaConditionIndex+1 // tried barindex before, but it's variableendifif (Chikou - pLow[window])*pipfactor>soglia thendivergenzaShortCondizione = 1divergenzaConditionIndex = divergenzaConditionIndex+1endifif barindex-divergenzaConditionIndex > divergenzaSeniority thendivergenzaLongCondizione = 0divergenzaShortCondizione = 0divergenzaConditionIndex = 0endifif divergenzaLongCondizione thenendifCONDIZIONILONG= divergenzaLongCondizioneCONDIZIONISTOPLONG=0 and spana <> spanbCONDIZIONISHORT= divergenzaShortCondizioneCONDIZIONISTOPSHORT=0// Condizioni per entrare su posizioni longIF NOT LongOnMarket AND CONDIZIONILONG THENBUY 1 CONTRACTS AT MARKETSET TARGET PPROFIT TPSET STOP pLOSS SLENDIF// Condizioni per uscire da posizioni longIf LongOnMarket AND CONDIZIONISTOPLONG THENSELL AT MARKETENDIF// Condizioni per entrare su posizioni shortIF NOT ShortOnMarket AND CONDIZIONISHORT THENSELLSHORT 1 CONTRACTS AT MARKETSET TARGET PPROFIT TPSET STOP pLOSS SLENDIF// Condizioni per uscire da posizioni shortIF ShortOnMarket AND CONDIZIONISTOPSHORT THENEXITSHORT AT MARKETENDIF11/29/2016 at 9:08 AM #1744612/01/2016 at 6:11 PM #1767212/11/2016 at 9:18 AM #18232 -
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
Find exclusive trading pro-tools on
Similar topics: