stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

10.7/10.9 INDI SOLUTIONS
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3550
Page 18 of 72
Author:  fire580 [ Fri Apr 11, 2014 1:22 pm ]
Post subject:  10.7/10.9 INDI SOLUTIONS

Thanks Spotdespot they will be very helpful. :smile:
Author:  effluvium [ Fri Apr 11, 2014 10:07 pm ]
Post subject:  Technical question about Stochastic Value

Hi Tommaso,
First of all. Thank you for your great work and elaborating this very helpful indicator that could announce many improvment to analyse and to be in synch with PA direction. I went in depth in your code but I could not understand the purpose of these lines when you were calculating the valur of Stochastics:

You have written here:

Code: Select all

if(d == 1 && BrokerHasSundayCandle && HigherTF_Used==1440)
      {
        HigherTF1STOCH=((iStochastic(NULL,HigherTF_Used,K_period_HT,D_period_HT,S_period_HT,STOCH_MAIN_Ma_HT,STOCH_MAIN_Price_HT,MODE_MAIN,1))
               +BrokerHour *(iStochastic(NULL,HigherTF_Used,K_period_HT,D_period_HT,S_period_HT,STOCH_MAIN_Ma_HT,STOCH_MAIN_Price_HT,MODE_MAIN,1)))/(1+BrokerHour);;
      }
        if(d == 1 && BrokerHasSundayCandle && HigherTF2_Used==1440)
      {
      HigherTF2STOCH=  ((iStochastic(NULL,HigherTF2_Used,K_period_HT,D_period_HT,S_period_HT,STOCH_MAIN_Ma_HT,STOCH_MAIN_Price_HT,MODE_MAIN,1))
            +BrokerHour*(iStochastic(NULL,HigherTF2_Used,K_period_HT,D_period_HT,S_period_HT,STOCH_MAIN_Ma_HT,STOCH_MAIN_Price_HT,MODE_MAIN,1)))/(1+BrokerHour);;
      }
So if I put this in a more simple form : (Stoch_valueTF + brokerHour * Stoch_valueTF) / (1 + brokerHour)
DO you agree ?
So the numerator could be expressed by : Stoch_valueTF * (1+ brokerHour) . Correct ?
And the whole formula will result in Stoch_valueTF by simplifying (1+ brokerHour) in numerator and denominator. You see ? if I have (X + a.X) / (1+a) the result will be just : X

Another question:
You have declared 2 variables m_bar=0; and n_bar = 0;
But nowhere in your code These variables were used to keep other values, so why do you use them. ?
You could simply put 0 as a shift value in the 1st stochastic formula

int n_bar=0;//Need to deal with a Sunday candle
Author:  milanese [ Fri Apr 11, 2014 10:16 pm ]
Post subject:  Technical question about Stochastic Value

effluvium » Fri Apr 11, 2014 10:07 pm wrote:Hi Tommaso,
First of all. Thank you for your great work and elaborating this very helpful indicator that could announce many improvment to analyse and to be in synch with PA direction. I went in depth in your code but I could not understand the purpose of these lines when you were calculating the valur of Stochastics:

You have written here:

Code: Select all

if(d == 1 && BrokerHasSundayCandle && HigherTF_Used==1440)
      {
        HigherTF1STOCH=((iStochastic(NULL,HigherTF_Used,K_period_HT,D_period_HT,S_period_HT,STOCH_MAIN_Ma_HT,STOCH_MAIN_Price_HT,MODE_MAIN,1))
               +BrokerHour *(iStochastic(NULL,HigherTF_Used,K_period_HT,D_period_HT,S_period_HT,STOCH_MAIN_Ma_HT,STOCH_MAIN_Price_HT,MODE_MAIN,1)))/(1+BrokerHour);;
      }
        if(d == 1 && BrokerHasSundayCandle && HigherTF2_Used==1440)
      {
      HigherTF2STOCH=  ((iStochastic(NULL,HigherTF2_Used,K_period_HT,D_period_HT,S_period_HT,STOCH_MAIN_Ma_HT,STOCH_MAIN_Price_HT,MODE_MAIN,1))
            +BrokerHour*(iStochastic(NULL,HigherTF2_Used,K_period_HT,D_period_HT,S_period_HT,STOCH_MAIN_Ma_HT,STOCH_MAIN_Price_HT,MODE_MAIN,1)))/(1+BrokerHour);;
      }
So if I put this in a more simple form : (Stoch_valueTF + brokerHour * Stoch_valueTF) / (1 + brokerHour)
DO you agree ?
So the numerator could be expressed by : Stoch_valueTF * (1+ brokerHour) . Correct ?
And the whole formula will result in Stoch_valueTF by simplifying (1+ brokerHour) in numerator and denominator. You see ? if I have (X + a.X) / (1+a) the result will be just : X
Yes I agree with your exampel ,but if you take an exact look at the brakets, than you will see that this is used for the addition from the suday monday candles and put them in a relation to wight the monday second the monday hours passed, it is experimental code, a try to resolve the sunday candle problem.. only used if broker has sunday candle which is dedected automatic.., but this is a part of the indicator I am still working with.. so it is in an experimental stage..

Cheers :)

Tommaso
Author:  SpiderX [ Sat Apr 12, 2014 7:29 am ]
Post subject:  10.7/10.9 INDI SOLUTIONS

hi Tommaso,

Code: Select all

   limit=Bars-counted_bars+Period()/Period();
   limit=Bars-counted_bars+HigherTF_Used/Period();
   limit=Bars-counted_bars+HigherTF2_Used/Period();
   limit=Bars-counted_bars+HigherTF3_Used/Period();
Notice this bunch of code in the 10.9 indicator....is there any purpose to this code ?
The value of the last line overwrites the value of the previous 3 lines, so we might as well delete the first 3 lines....
Also first line will always compute to Bars-counted_bars+1 ....Since Period()/Period() is always 1.

Cheers
Author:  milanese [ Sat Apr 12, 2014 8:52 am ]
Post subject:  10.7/10.9 INDI SOLUTIONS

SpiderX » Sat Apr 12, 2014 7:29 am wrote:hi Tommaso,

Code: Select all

   limit=Bars-counted_bars+Period()/Period();
   limit=Bars-counted_bars+HigherTF_Used/Period();
   limit=Bars-counted_bars+HigherTF2_Used/Period();
   limit=Bars-counted_bars+HigherTF3_Used/Period();
Notice this bunch of code in the 10.9 indicator....is there any purpose to this code ?
The value of the last line overwrites the value of the previous 3 lines, so we might as well delete the first 3 lines....
Also first line will always compute to Bars-counted_bars+1 ....Since Period()/Period() is always 1.

Cheers
It has propose for correct calculations of the higher TF stoch in lower TF the first one is the normal caclculation, but for showing how this works it is here coded in same way like the others..

Cheers :)

Tommaso
Author:  effluvium [ Sat Apr 12, 2014 2:09 pm ]
Post subject:  10.7/10.9 INDI SOLUTIONS

SpiderX » Sat Apr 12, 2014 8:29 am wrote:hi Tommaso,

Code: Select all

   limit=Bars-counted_bars+Period()/Period();
   limit=Bars-counted_bars+HigherTF_Used/Period();
   limit=Bars-counted_bars+HigherTF2_Used/Period();
   limit=Bars-counted_bars+HigherTF3_Used/Period();
Notice this bunch of code in the 10.9 indicator....is there any purpose to this code ?
The value of the last line overwrites the value of the previous 3 lines, so we might as well delete the first 3 lines....
Also first line will always compute to Bars-counted_bars+1 ....Since Period()/Period() is always 1.

Cheers
I agree with SpiderX. If you put a series of assigments to the same variable, (without conditional events), that means that no matter the number of assignments, the variable "limit" will store the calculation of the last assignment. So you the whole first 3 assignments is just garbage, and will consume UC time for nothing, even if it some micro-seconds. (Also in the first assignment period()/Period() equals 1)
Author:  milanese [ Sat Apr 12, 2014 3:33 pm ]
Post subject:  10.7/10.9 INDI SOLUTIONS

effluvium » Sat Apr 12, 2014 2:09 pm wrote:
SpiderX » Sat Apr 12, 2014 8:29 am wrote:hi Tommaso,

Code: Select all

   limit=Bars-counted_bars+Period()/Period();
   limit=Bars-counted_bars+HigherTF_Used/Period();
   limit=Bars-counted_bars+HigherTF2_Used/Period();
   limit=Bars-counted_bars+HigherTF3_Used/Period();
Notice this bunch of code in the 10.9 indicator....is there any purpose to this code ?
The value of the last line overwrites the value of the previous 3 lines, so we might as well delete the first 3 lines....
Also first line will always compute to Bars-counted_bars+1 ....Since Period()/Period() is always 1.

Cheers
I agree with SpiderX. If you put a series of assigments to the same variable, (without conditional events), that means that no matter the number of assignments, the variable "limit" will store the calculation of the last assignment. So you the whole first 3 assignments is just garbage, and will consume UC time for nothing, even if it some micro-seconds. (Also in the first assignment period()/Period() equals 1)
There is no doubt that you are right about what is doing, It is in the code for making it easier to understand for others how to code a MTF indicator, and why you normally use counted_bars+1 ..... and it will not make much difference for the CPU use if you will comment it out, nearly zero..
Feel free to comment it out if you want :smile:

Cheers :)

Tommaso
Author:  milanese [ Sun Apr 13, 2014 10:31 am ]
Post subject:  10.7/10.9 INDI SOLUTIONS

I attached too in first post http://www.stevehopwoodforex.com/phpBB3 ... 742#p89742 the CSS 10.7 24 pairs with popup crossover alerts (too email alerts are possible) for anyone who is interested...

Cheers :)

Tommaso
Author:  SpiderX [ Sun Apr 13, 2014 4:04 pm ]
Post subject:  10.7/10.9 INDI SOLUTIONS

Hi all,

Attached is a modified version of padnoter's original 10.6 dashboard for 10.7/10.9.
The purpose of the dashboard is to save the time of flipping 20 over charts to look for a trade.
It was a relatively rush job with certain elements not working yet:
1. Does not take into account for Sunday candles. (if there is a request for this, maybe we need Tommaso's help to add this)
2. autoSymbols do not work. Not sure why, but not enough time to figure this out, probably someone can help look into this.

Thanks again to padnoter for the original dashboard.
I retained the 1st column to the right which was 10.6 stuff for reference purposes.

Users may adjust the below levels on the stoch to determine the high/low which affects when the text colours on the stochs will change.

Code: Select all

extern double stoch_high = 70;
extern double stoch_low  = 30;
Basically, we look at the colour of the numbers on the Stoch to determine whether there is a potential trade, Green means potential buy, Red means potential sell.
For example, in the picture, the green on the EURAUD D1stoch means a potential 10.9 buy on it.
While the red on the M30,M15 stoch of EURCHF indicate potential 10.7 sells on this.


For any coders who are diving into this code and spot mistakes, please do not hesitate to correct it.
Once again, if your broker has Sunday candles, this might not work so well for you.

Cheers

Updates
v1.01
info: http://www.stevehopwoodforex.com/phpBB3 ... 180#p90719

-Increased font size per Bob's request
-Spilt into two columns
-Additional inputs

Code: Select all

extern double stochclose_high = 85;
extern double stochclose_low  = 15;
Text will become yellow when indicators align uptrend and stoch value is high or vice versa. This would signal time to let go of an existing trend trade.

v1.02

-Fixed bug with diamonds appearing wrongly with wrong colour

v1.03

-Adjusted the indicator code , so font resize works without affecting the overall alignment

Code: Select all

extern int wrap=14;
extern string Font = "Arial";
extern int FontSize=12;
Now it is possible to adjust font size to your personal preference.
Also, adjust the wrap parameter according to the number of pairs you have running.

-Added in code to automatically remove invalid pairs not offered by your broker

v1.04
-fixed autoSymbols error - now autoSymbols work
-added autowrap feature, so no need to set value for wrap unless you like to.

Code: Select all

extern bool autowrap = true;
extern int wrap=14;
-additional feature - discussed in the below post:
http://www.stevehopwoodforex.com/phpBB3 ... 278#p91278

Code: Select all

extern string  gen1b               = "set Currency Direction.Allowable Values: -1,0,1";
extern bool showCSSDirection      = false;
extern int  AUD_Dir               = 0;
extern int  EUR_Dir               = 0;
extern int  CAD_Dir               = 0;
extern int  CHF_Dir               = 0;
extern int  GBP_Dir               = 0;
extern int  JPY_Dir               = 0;
extern int  NZD_Dir               = 0;
extern int  USD_Dir               = 0;
v1.05

-Added Dashboard configuration, use this to remove stuff you dont need.

Code: Select all

extern string  gen1d               = "set Dashboard Configuration";
extern bool showTrend   =true;
extern bool showM15Sto  =true;
extern bool showM30Sto  =true;
extern bool showH1Sto   =true;
extern bool showH4Sto   =true;
extern bool showD1Sto   =true;
extern bool showD1_21   =true;
extern bool showWK_21   =true;
extern bool showMN_21   =true;
-Added secondsToUpdate option, so indicator does not update every tick

Code: Select all

extern string  gen1a               = "Set update time, 0 seconds to update everytick";
extern int secondsToUpdate=15;
-Updated pair name colour code as suggested by alorente
Red - when WK2.1, D2.1 , DStoch direction are aligned down , with either one of the selected stoch timeframes aligned down
Green - when WK2.1, D2.1 , DStoch direction are aligned up , with either one of the selected stoch timeframes aligned up
Yellow - when WK2.1, D2.1 , DStoch direction are aligned up/down , with none of the selected stoch timeframes aligned properly

v1.06

-Fixed bug that caused indicator to not load when Empty4 is started
-Broker suffix would be removed from pair names displayed.
-Implemented showOnyRelevant to hide the white pairs. Thanks to VirtualFM for this upgrade !

Code: Select all

extern bool showOnlyRelevant  =true;

-Implemented pairColorMode , 0 is for original pair colour code, 1 for pair colour code requested by alronte

Code: Select all

extern int pairColourMode = 1;
Pair Colour Code 0:
Lime: W2.1 and D2.1 are aligned up, h1 stoch prev below stoch low, h1 stoch is above stoch low
Lime(Bold): W2.1 and D2.1 are aligned up, h4 stoch prev below stoch low, h4 stoch is above stoch low
Red: W2.1 and D2.1 are aligned dn, h1 stoch prev above stoch high, h1 stoch is below stoch high
Red(Bold): W2.1 and D2.1 are aligned dn, h4 stoch prev above stoch high, h4 stoch is below stoch high
Yellow : W2.1 and D2.1 are aligned up, h1 stoch below stoch low,
W2.1 and D2.1 are aligned dn, h1 stoch above stoch high
Yellow(Bold):W2.1 and D2.1 are aligned up, h4 stoch below stoch low,
W2.1 and D2.1 are aligned dn, h4 stoch above stoch high

Pair Colour Code 1:
Red - when WK2.1, D2.1 , DStoch direction are aligned down , with either one of the selected stoch timeframes above stoch high
Lime - when WK2.1, D2.1 , DStoch direction are aligned up , with either one of the selected stoch timeframes below stoch low
BrickRed - when WK2.1, D2.1 , DStoch direction are aligned down, with none of the selected stoch timeframe at the right level
Green - when WK2.1, D2.1 , DStoch direction are aligned up, with none of the selected stoch timeframe at the right level
Red and Lime will be bold when the selected stoch is moving in the right direction (i.e: Time to buy or sell as defined by al)


v1.07a (a because had not much time to test this, so expecting to release version b, if there is a bug )
-Added customizable colour codes for pair names/Stoch/CSS colours

Code: Select all

extern string  gen1d2               = "Set Color Configuration for Stoch Numbers";
extern color StochUpTrend     = Lime;
extern color StochDnTrend     = Red;
extern color StochCloseLevel  = Yellow;
extern color StochNeutral     = White;
extern color Stoch21Up        = Lime;
extern color Stoch21Dn        = Red;

extern string  gen1d3               = "Set Color Configuration for Pair Names - Mode 1";
extern color PairAlignedUpWithoutStoch    = Green;
extern color PairAlignedUpWithStoch       = Lime;
extern color PairAlignedDnWithoutStoch    = FireBrick;
extern color PairAlignedDnWithStoch       = Red;
extern color PairUnaligned                = DarkGray;

extern string  gen1d4               = "Set Color Configuration for Manual CSS";
extern color CcyUp                = Lime;
extern color CcyDn                = Red;
extern color CcyUncertain         = SkyBlue;
extern color PairCSSUp            = Lime;
extern color PairCSSDn            = Red;
extern color PairCSSUnaligned     = Yellow;
extern color PairCSSUncertain     = SkyBlue;
-Added Alerts
Use timeBetweeAlertSeconds to set delay between alerts on each pair.

Code: Select all

extern string  gen1e               = "Set Alerts Configuration";
extern bool      PopupAlert= false;  
extern bool      EmailAlert= false;
extern bool      PushAlert = false;
extern bool      timeBetweenAlertSeconds = 3600;

-Added showD1Trend option
If set to false, indicator will show H4 trend instead of D1 trend.
Option only works for pairColourMode 0.
Trend is default to D1 for pairColourMode 1.

Code: Select all

extern bool showD1Trend = true;
v1.07b

fixed some bug with autosymbol when there are too many symbols from broker
fixed bug with ignore

v1.07c
fixed alerts to display pair name
fixed minor bug with wrap

v1.07d
fixed bug with time delay between alerts

v1.07e
fixed bug with diamond colour code of the D2.1, WK2.1 Sto
Author:  fire580 [ Sun Apr 13, 2014 9:39 pm ]
Post subject:  10.7/10.9 INDI SOLUTIONS

Thank you spiderX - I was praying for something like this. :yahoo:
All times are UTC Page 18 of 72