Converting idea into indicator
Forums › ProRealTime English forum › ProBuilder support › Converting idea into indicator
- This topic has 4 replies, 2 voices, and was last updated 2 years ago by DilwynEvs.
-
-
01/28/2022 at 1:48 PM #186837
Good afternoon All
I’ve done a bit of basic indicator coding – bar colour changes etc but I presume that the attached is more related to arrays etc ??? beyond me at the moment.
If anybody can make sense of the attached and point me in the right direction and any pitfalls I need to be aware of .
Thanks in advance
01/29/2022 at 12:30 PM #186952Can you explain in details what your pic shows, to be able to better understand what you need?
01/29/2022 at 1:15 PM #186963I’ve been working on the code and I’ve got it working.
I’ve gone as far as 10 bars at the moment – is there a simpler way rather than generating longer formula for each line ??
My stopping point at the moment is setting a minimum number of results through input value – its giving me random results ??
Thanks in advance
1234567891011121314151617181920212223242526272829303132333435363738394041424344if ((NewThree == true) && (H2>H1)&&(H2>H3) && (H4 >C2)&&(H4 <H2)&&(H4 >H5 ) && (H4 >H3) ){ HighH4 = 1 ; }if ((NewThree == true) && (H2>H1)&&(H2>H3) && (H5 >C2)&&(H5 <H2)&&(H5 >H6 ) && (H5 >H3)&&(H5 >H4) ){ HighH5 = 1 ; }if ((NewThree == true) && (H2>H1)&&(H2>H3) && (H6 >C2)&&(H6 <H2)&&(H6 >H7 ) && (H6 >H3)&&(H6 >H4)&&(H6 >H5) ){ HighH6 = 1 ; }if ((NewThree == true) && (H2>H1)&&(H2>H3) && (H7 >C2)&&(H7 <H2)&&(H7 >H8 ) && (H7 >H3)&&(H7 >H4)&&(H7 >H5)&&(H7> H6) ){ HighH7 = 1 ; }if ((NewThree == true) && (H2>H1)&&(H2>H3) && (H8 >C2)&&(H8 <H2)&&(H8 >H9 ) && (H8 >H3)&&(H8 >H4)&&(H8 >H5)&&(H8> H6)&&(H8 > H7) ){ HighH8++ ; }if ((NewThree == true) && (H2>H1)&&(H2>H3) && (H9 >C2)&&(H9 <H2)&&(H9 >H10) && (H9 >H3)&&(H9 >H4)&&(H9 >H5)&&(H9> H6)&&(H9 > H7)&&(H9 > H8) ){ HighH9++ ; }if ((NewThree == true) && (H2>H1)&&(H2>H3) && (H10>C2)&&(H10<H2)&&(H10>H11) && (H10>H3)&&(H10>H4)&&(H10>H5)&&(H10>H6)&&(H10> H7)&&(H10> H8)&&(H10> H9) ){ HighH10 = 1 ; }if ((NewThree == true) && (H2>H1)&&(H2>H3) && (H11>C2)&&(H11<H2)&&(H11>H12) && (H11>H3)&&(H11>H4)&&(H11>H5)&&(H11>H6)&&(H11> H7)&&(H11> H8)&&(H11> H9)&&(H11> H10) ){ HighH11 = 1 ; }uchar HighH_Total = HighH4 + HighH5 + HighH6 + HighH7 + HighH8 + HighH9 + HighH10 + HighH11 ;if ((NewThree == true) && (HighH_Total >= MinimumCount)){ val3[shift3]=High[shift3]; val4[shift3]=Low[shift3];HighH4=0; HighH5=0; HighH6=0; HighH7=0; HighH8=0; HighH9=0; HighH10=0; HighH11=0 ; }01/29/2022 at 1:58 PM #186972The idea is working on the peaks of the highs as per attachment
Criteria’s as follows
1.Previous Peaks – cant be higher than the peak being tested
2. Previous Peaks – cant be lower than any bar that’s been previous
3. Previous Peaks – cant be lower than peak test bar close
4. This can happen on numerous occasions until we go above the test peak high
5. Once finished a minimum peaks criteria needs to be met before the test peak candle can be highlighted.
Hope it makes more sense
Thanks in advance
02/01/2022 at 8:53 AM #187202A bit more learning over the weekend
Can anybody highlight what basic errors are stopping this loop from working ?
123456789101112131415161718192021222324252627282930313233/*input bool PeakTest = true; //------------------ Highlighting Inputs used---------------------//input bool PeakTest1 = true;input uchar MinimumCount = 2 ;input uchar ScanMaxCount = 10;*/int i, BarCount= 0;double A1, A2, A3 ;double HighestHigh = High[4], HighBar = High[3], Total = 1;for (i=4; i<=ScanMaxCount-1; i++) // 4<=10 : i=5 need to scan till criteria met : from Bar[4] to Bar[10] // From zero (!) to..{if ((PeakTest1 == true) && (H2>H1)&&(H2>H3)&&(H2>H4) // Initial Test&& ((HighestHigh<H2) == true)) { HighBar = High[i]; // If test is met HighBar = High[4] :{if ((HighestHigh>HighBar) == true) { HighestHigh = High[i]; // If High[4]>High[3] : HighestHigh = [4]{if ((HighestHigh>C2) == true) { A1 = High[i--]; A2 = High[i]; A3 = High[i++]; // If High[4]>Close[2] : A1 = High[3] A2 = High[4] A3 = High[5]{if (((A2>A1)&&(A2>A3)) == true) { BarCount++; // If High[4]>High[3] && High[4]>High[5] : Bar Count = 1{if ((BarCount>MinimumCount) == true) { val4[shift3]=High[shift3]; val3[shift3]=Low[shift3]; // If 1>10 : Highlight Bar[2]}}}}} // Continue testing until criteria is met}}}}} -
AuthorPosts
Find exclusive trading pro-tools on