Mike.T: If I have a rectangle eg. H=20 W=100
|
|
Mike.T: If I have a rectangle eg. H=20 W=100 |
|
Hi Roeder
Thanx... that's what I was looking for... So I can calculate the size of my chart (using - CHART_HEIGHT_IN_PIXELS)and then multiply my Static Object co-ordinates/values by that proportional fraction... if "full screen" = 100%...
Ok... I'll try that... thanx
PS: I don't have code to paste yet... I was wondering if it was possible...
Hi Roeder
Thanx... that's what I was looking for... So I can calculate the size of my chart (using - CHART_HEIGHT_IN_PIXELS)and then multiply my Static Object co-ordinates/values by that proportional fraction... if "full screen" = 100%...
Ok... I'll try that... thanx
PS: I don't have code to paste yet... I was wondering if it was possible...
Hi Roeder... thanx... that really put me on the right track...
What I've done is simply create a function that multiplies my static objects by a coefficient... I haven't tested it yet but in theory it should work... this is my function..
//+-------------------------------------+ //| Proportional Objects Function | //+-------------------------------------+ void proportional_Function() { double FullScreenHeight = 356; // Obviously you could set up an extern variable input for this double FullScreenWidth = 1317; //Ditto height=ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS,0); width=ChartGetInteger(0,CHART_WIDTH_IN_PIXELS,0); Height_Coeficient = (height/FullScreenHeight)*100; Width_Coeficient = (width/FullScreenWidth)*100; }
So thanx...
I obviously then just multiply my Objects (Height/Width) with the Height/Width-Coeficient.... should work... thanx
Hi Roeder... thanx... that really put me on the right track...
What I've done is simply create a function that multiplies my static objects by a coefficient... I haven't tested it yet but in theory it should work... this is my function..
So thanx...
I obviously then just multiply my Objects (Height/Width) with the Height/Width-Coeficient.... should work... thanx
Ok... that works like a charm.... As a matter of interest... it slows things up a bit... but if you have a Profile with 6 charts and you have static Objects or ObjectLables.... then this is a very neat trick to getting everything into perspective... I havn't worked out how to get the TestLables to fit... but it's now just a matter of playing around...

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Does anyone know if it is possible to create objects on the chart that are proportional to the chart screen size....? ie. If I have a rectangle eg. H=20 W=100 when my chart is "Full Screen"... those rectangle stats become H= 10 W=50 when the chart size is minimized to half the full screen...
If "yes" could you please point me in the right direction here... thanx