PivotTrades

MPTM's new home
Locked
User avatar
Wavegarrick
Trader
Posts: 1172
Joined: Sun Dec 30, 2012 11:21 am
Location: South Africa

PivotTrades

Post by Wavegarrick »

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
You do not have the required permissions to view the files attached to this post.
vinvlad
Posts: 1
Joined: Fri Jun 12, 2015 3:49 pm

PivotTrades

Post by vinvlad »

Big thanks to Tomele for the development. :clap:
Is it possible to add a GMT shift ?
milosz
Trader
Posts: 19
Joined: Mon Dec 24, 2012 2:41 pm

PivotTrades

Post by milosz »

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
You do not have the required permissions to view the files attached to this post.
heart1010
Trader
Posts: 56
Joined: Wed Mar 30, 2016 8:33 pm

PivotTrades

Post by heart1010 »

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: :?:
User avatar
tomele
Administrator
Posts: 1208
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

PivotTrades

Post by tomele »

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.
Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
heart1010
Trader
Posts: 56
Joined: Wed Mar 30, 2016 8:33 pm

PivotTrades

Post by heart1010 »

Thanks for explanations!
User avatar
tomele
Administrator
Posts: 1208
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

PivotTrades

Post by tomele »

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.
Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
User avatar
tomele
Administrator
Posts: 1208
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

PivotTrades

Post by tomele »

Hi folks,

head still above water:
XAUUSDH1.png
You do not have the required permissions to view the files attached to this post.
Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

PivotTrades

Post by SteveHopwood »

:clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :party: :party: :party: :party: :party: :party: :party: :party: :party: :party: :!!: :!!: :!!: :!!: :!!: :!!: :!!: :!!: :!!: :!!:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
DocT
Trader
Posts: 149
Joined: Mon Apr 23, 2012 9:44 am
Location: Aberdeen

PivotTrades

Post by DocT »

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:
Locked

Return to “Utilities Indicators and Scripts”