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

PivotTrades
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5096
Page 5 of 8
Author:  Wavegarrick [ Wed Mar 29, 2017 12:22 pm ]
Post subject:  PivotTrades

Trades as posted on monday. Eurusd....I can live with this :) a perfect bounce off weekly resistance 1.

Target 1 @ 1.0700 & target 2 monthly pivot ?.We shall see.

Cheers
EURUSDH4 290317.png
Author:  vinvlad [ Wed Mar 29, 2017 5:39 pm ]
Post subject:  PivotTrades

Big thanks to Tomele for the development. :clap:
Is it possible to add a GMT shift ?
Author:  milosz [ Fri Mar 31, 2017 11:39 am ]
Post subject:  PivotTrades

Hi Tomele and SHF community,

Thank you for this elegant indicator and simple system (I'll look into it). I'm curently experimenting with Gann fans and this tool comes handy in pinpointing areas of possible price corrections. It provides additional source of confluence and like we all know - the more confluence, the better.
gann+tomelepivots.PNG
Best regards,
Milosz
Author:  heart1010 [ Tue Apr 04, 2017 8:15 am ]
Post subject:  PivotTrades

Thanks @tomele

I had a short view into the code and wondering of that "result" lines (2nd overrights 1st but result are never used later) :roll:

Code: Select all

int start()
{  
   // calculate the zoomfactor as pixels per bar
   int x1,x2,y,zoomfactor;
   bool result;
   result=ChartTimePriceToXY(0,0,iTime(NULL,0,0),0,x1,y);
   result=ChartTimePriceToXY(0,0,iTime(NULL,0,1),0,x2,y);
   zoomfactor=x1-x2;
Then your indicator is doing all the work/for loops again and again on every tick. Is this really needed or couldn't we save here some CPU and only do that once a bar or when a new high/low is printed?
The pivot calculations are all based on prices of the past, so we have to that only once, don't we? So we only had to shift the objects to the right on every new bar without any new calcualtions done :roll: :?:
Author:  tomele [ Tue Apr 04, 2017 10:15 am ]
Post subject:  PivotTrades

heart1010 wrote: I had a short view into the code and wondering of that "result" lines (2nd overrights 1st but result are never used later) :roll:

Code: Select all

int start()
{  
   // calculate the zoomfactor as pixels per bar
   int x1,x2,y,zoomfactor;
   bool result;
   result=ChartTimePriceToXY(0,0,iTime(NULL,0,0),0,x1,y);
   result=ChartTimePriceToXY(0,0,iTime(NULL,0,1),0,x2,y);
   zoomfactor=x1-x2;
Have a look into the MQ4 manual for ChartTimePriceToXY(). You might understand the code then.
Then your indicator is doing all the work/for loops again and again on every tick. Is this really needed or couldn't we save here some CPU and only do that once a bar or when a new high/low is printed?
The pivot calculations are all based on prices of the past, so we have to that only once, don't we? So we only had to shift the objects to the right on every new bar without any new calcualtions done :roll: :?:
I dont know of any command in MQ4 to "shift bars to the right". The bars are objects on the time axis and there is a bunch of code needed to calculate their positions as new bars appear. As well as on changed timeframe, zoomfactor etc. And as the chart timeframe can be bigger than the timeframe for the pivot calculation it is even more complex.

At the moment, I am not worried about cpu consumption. It started as an experiment and works as it is. I might rewrite it in a future version to only recalculate on new bars, chart events and pivot recalculations if I am happy enough with the trading results.
Author:  heart1010 [ Tue Apr 04, 2017 10:20 am ]
Post subject:  PivotTrades

Thanks for explanations!
Author:  tomele [ Tue Apr 04, 2017 11:41 am ]
Post subject:  PivotTrades

vinvlad ยป 29 Mar 2017, 18:39 wrote:Big thanks to Tomele for the development. :clap:
Is it possible to add a GMT shift ?
Maybe in a later version.
Author:  tomele [ Sun Apr 16, 2017 10:02 pm ]
Post subject:  PivotTrades

Hi folks,

head still above water:
XAUUSDH1.png
Author:  SteveHopwood [ Sun Apr 16, 2017 10:08 pm ]
Post subject:  PivotTrades

:clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :party: :party: :party: :party: :party: :party: :party: :party: :party: :party: :!!: :!!: :!!: :!!: :!!: :!!: :!!: :!!: :!!: :!!:
Author:  DocT [ Tue Apr 18, 2017 3:03 pm ]
Post subject:  PivotTrades

Guys

Its been a while since I have logged in and I find this wee gem here!!!

Great work on both coding and trading. I am going to fire this up on a spare instance and play along ;-)

Thanks :clap:
All times are UTC Page 5 of 8