COLORE INDICATORE CONDIZIONATO
Forums › ProRealTime forum Italiano › Supporto ProBuilder › COLORE INDICATORE CONDIZIONATO
- This topic has 17 replies, 3 voices, and was last updated 9 months ago by PaFM.
-
-
03/07/2024 at 6:42 PM #229419
Buon tentativo… ‘Colorbetween’ è un cliente ingannevole in questo caso.
Non lo capisco ancora del tutto, ma posso usare abbastanza per portare a termine il lavoro per ora.
Druby
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117// constantsperiod = 13deviation1 = 1deviation2 = 2deviation3 = 3up = 1down = -1begin = 1null = 0// (i) indicatorsiSTD1 = deviation1 * STD[period](close)iSTD2 = deviation2 * STD[period](close)iSTD3 = deviation3 * STD[period](close)iSMA = Average[period,0](close)// (c) conditionscUpperBand3 = iSMA + iSTD3 // ----3----cUpperBand2 = iSMA + iSTD2 // ----2----cUpperBand1 = iSMA + iSTD1 // ----1----cMiddleBand = iSMA // ----0----cLowerBand1 = iSMA - iSTD1 // ----1----cLowerBand2 = iSMA - iSTD2 // ----2----cLowerBand3 = iSMA - iSTD3 // ----3----// delay startif begin = 1 and barindex < period then // hold off till enough bar presentts = undefined // removes ts tangent line from 0 til real value availableelsebegin = 0endif// logic operation// setup block --> When 'begin' = 0, executes next block.// Since 'trend' default = 0, being set to 1 or -1 will// allow the 'following' logic code blocks to be executed// Bollinger Logic -----------// initial, set trend, trend only changed by iSTD1if begin = null thenif close crosses over cUpperband1 thentrend = upelsif close crosses under cLowerBand1 thentrend = downendifendif// following from first time after trend set!// change of trend, up --> downif trend = up and close crosses under cLowerBand1 thentrend = downendif// change of trend, down --> upif trend = down and close crosses over cUpperBand1 thentrend = upendif// set 'ts' values to appropriate band threshold levelif trend = up thents = cLowerBand1elsif trend = down thents = cUpperBand1endif// drawing ==============================================================================// color settingsif trend = up thenr = 0g = 255a1 = 90 // on upperband 3 greena2 = 70 // on upperband 2 greena3 = 50 // on upperband 1 greena4 = 30 // on lowerband 1 greena5 = 0 // off upperBand 1 reda6 = 0 // off lowerBand 1 reda7 = 0 // off lowerBand 2 reda8 = 0 // off lowerBand 3 redelsif trend = down thenr = 255g = 0a1 = 0 // off upperband 3 greena2 = 0 // off upperband 2 greena3 = 0 // off upperband 1 greena4 = 0 // off lowerband 1 greena5 = 30 // on upperBand 1 reda6 = 50 // on lowerBand 1 reda7 = 70 // on lowerBand 2 reda8 = 90 // on lowerBand 3 redendif// band colors - # turn of any conflicting 'colour zones' in 'config settings'!!!// greencolorbetween(cUpperBand2,cUpperBand3, r,g,0,a1) // upperBand3 green - trend upcolorbetween(cUpperBand1,cUpperBand2, r,g,0,a2) // upperBand2 green - trend upcolorbetween(cMiddleBand,cUpperBand1, r,g,0,a3) // upperBand1 green - trend upcolorbetween(cMiddleBand,cLowerBand1, r,g,0,a4) // lowerBand1 green - trend up// redcolorbetween(cMiddleBand,cUpperBand1, r,g,0,a5) // upperBand1 red - trend downcolorbetween(cMiddleBand,cLowerBand1, r,g,0,a6) // lowerBand1 red - trend downcolorbetween(cLowerBand1,cLowerBand2, r,g,0,a7) // upperBand2 red - trend downcolorbetween(cLowerBand2,cLowerBand3, r,g,0,a8) // upperBand3 red - trend downreturn ts coloured(r,g,50) style(line,1) as "dev", cMiddleBand coloured(r,g,50) style(dottedline,1)as "sma"1 user thanked author for this post.
03/07/2024 at 8:05 PM #229422ottimizzazione, funziona anche questo!
12345678910111213141516171819202122232425262728293031323334// color settingsif trend = up thenr = 0g = 255 // set all colorbetween's greena1 = 90 // on upperband 3a2 = 70 // on upperband 2a3 = 50 // on upperband 1a4 = 30 // on lowerband 1a5 = 0 // off lowerBand 2a6 = 0 // off lowerBand 3elsif trend = down thenr = 255 // set all colorbetween's redg = 0a1 = 0 // off upperband 3a2 = 0 // off upperband 2a3 = 30 // on upperBand 1a4 = 50 // on lowerBand 1a5 = 70 // on lowerBand 2a6 = 90 // on lowerBand 3endifcolorbetween(cUpperBand2,cUpperBand3, r,g,0,a1) // upperBand3 green - trend upcolorbetween(cUpperBand1,cUpperBand2, r,g,0,a2) // upperBand2 green - trend upcolorbetween(cMiddleBand,cUpperBand1, r,g,0,a3) // upperBand1 green/red - trend up/downcolorbetween(cMiddleBand,cLowerBand1, r,g,0,a4) // lowerBand1 green/red - trend up/downcolorbetween(cLowerBand1,cLowerBand2, r,g,0,a5) // lowerBand2 red - trend downcolorbetween(cLowerBand2,cLowerBand3, r,g,0,a6) // lowerBand3 red - trend down1 user thanked author for this post.
03/08/2024 at 3:34 AM #229430 -
AuthorPosts
Find exclusive trading pro-tools on
Similar topics: