How do you usually exeute trades calculated by Position Size Calculator?

  • Manually

    Votes: 12 15.2%
  • PSC-Trader script with a mouse click

    Votes: 13 16.5%
  • PSC-Trader with a keyboard shortcut

    Votes: 51 64.6%
  • Using third-party trading panel

    Votes: 2 2.5%
  • Other (please provide details)

    Votes: 1 1.3%

  • Total voters
    79
  • Poll closed .
Status
Not open for further replies.

Enivid

Administrator
Staff member
Nov 30, 2008
18,619
1,366
144
Odesa
www.earnforex.com
Try the attached. Set the subwindow parameter accordingly if you have other subwindows (oscillators, etc.) on the chart. It cannot be detected automatically because all objects are created on indicator's initialization.
 

Attachments

  • PositionSizeCalculator_sepwind.mq4
    13.3 KB · Views: 24

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
Very, Very pleased - excellent job - Thank You

PSC_sw_zps26fc77b6.jpg


Except . . . . Where's the TakeProfit ?

H'mmm

The Entry Lvl and Stop-Loss sort themselves out (Blue & Green)

I added and named the Yellow TakeProfitLine - Which works - in so much as it effects the calculations when moved.

But it should be showing in what is a Black Gap between Stop-Loss and Acc. Balance

I have looked in MetaEditor but can find fault

Trying to remember what that software is called when you put two codes side by side for comparison - Can you remind me - Thank you

I noticed that you changed line 13 to #property indicator_separate_window But what else did you do - for future reference

I added the Volume Window as a test


For those wondering what this achieves - This is the dormant indi - MUCH BETTER

I actually forgot before taking the s/s But you can drag the 3 lines off screen when not in use

PSC_sw_rest_zps2fb197a6.jpg


Ah Ha I see it now . . . Is this - line 48 - extern int subwindow = 1; // Subwindow number the magic piece I needed for my attempt?

.
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
Looking Good

CHFJPY Looking Good - Although personally I will be changing the EntryLevel from Blue To Aqua and
the StopLoss to Lime and because I Spread Bet I will be changing Pos. Size to BetSize

But that's just me !

CHFJPY_zps8e2c7601.jpg


USDZAR Looking Good

USDZAR_zpsf761266c.jpg


GOLD Looking Good

GOLD_zps69c83c6a.jpg


NZDUSD Something Wrong

NZDUSD_zps931f6a85.jpg


NO MORE IMAGES ALLOWED - SO PROCEED TO MY REPLY

.
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
TakeProfitLine

NZDUSD - Add a TakeProfitLine

NZDUSD_2_zps5947b866.jpg


NZDUSD - Enter TakeProfitLine into Inputs

NZDUSD_3_zpsfbb18f35.jpg


NZDUSD - Voila - Just move the TakeProfitLine to get rid of the Invalid TP message

NZDUSD_4_zps3a70f6a0.jpg


NZDUSD - Looking Good

NZDUSD_5_zps30cee3be.jpg


.
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
Known Problems To Be Aware Of

1) You CANNOT add to a template and expect it to work

2) If it loads badly

Wrong_zpsb4acb584.jpg


Delete Indicator - Right click on chart and select Objects List - Select the three lines and Delete them.

They seem to hang - for whatever reason !

ObjectsList_zps74642775.jpg


Then try again

3) With most pairs there is NO PROBLEM

But for whatever reason on some you have to manually install the TakeProfitLine (see my previous post)

4) This indicator MUST be installed FIRST in any secondary window.


******************************************************************************************************************************
******************************************************************************************************************************

Sorry Enevid BUT this The code changes were to the ObjectCreate() calls to add a subwindow. means nothing to me - Is it not possible to tell me what needs adding
*******************************************************************************************************************************
*******************************************************************************************************************************

.
 
Last edited:

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
O'oops

With Respect I suspect your calculations are slightly wrong.

WHY ?

The Reward is NOT Risk, money * Reward/Risk

it is

Pos. Size * Reward/Risk (Bet Size * Odds)

The way I calculate it the Risk, money is the points difference between Entry Lvl and StopLoss * Pos. Size

Risk, money is what we stand to lose if it goes pear shaped and takes out the Stop Loss

Or am I looking at this all wrong because I have got my Spread Betting hat on ?

H'mmm

If this one is wrong - Then what about it's predecessors ?

.
 
Last edited:

Enivid

Administrator
Staff member
Nov 30, 2008
18,619
1,366
144
Odesa
www.earnforex.com
Delete Indicator - Right click on chart and select Objects List - Select the three lines and Delete them.

They seem to hang - for whatever reason !

There is an input parameter for that - DeleteLines. If you set it to true, the lines will be removed automatically when you remove or reload the indicator.

But for whatever reason on some you have to manually install the TakeProfitLine (see my previous post)

No need for that too. You just need to make sure there is no TP line left from some of previous instances of the indicator and set the TakeProfitLevel input parameter to some reasonable value.

4) This indicator MUST be installed FIRST in any secondary window.

No, you can just change the subwindow parameter to 2 or 3, or whatever, depending on how many subwindows your chart already has.
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,619
1,366
144
Odesa
www.earnforex.com
With Respect I suspect your calculations are slightly wrong.

WHY ?

The Reward is NOT Risk, money * Reward/Risk

it is

Pos. Size * Reward/Risk (Bet Size * Odds)

The way I calculate it the Risk, money is the points difference between Entry Lvl and StopLoss * Pos. Size

Risk, money is what we stand to lose if it goes pear shaped and takes out the Stop Loss

Or am I looking at this all wrong because I have got my Spread Betting hat on ?

H'mmm

If this one is wrong - Then what about it's predecessors ?

.

Reward cannot be Pos. Size * Reward/Risk because then we get the output value in lots. E.g. with position size = 0.01 and Reward/Risk = 3, we'd get Reward = 0.3 lots. What kind of reward is that?
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
Missing the point

Reward cannot be Pos. Size * Reward/Risk because then we get the output value in lots. E.g. with position size = 0.01 and Reward/Risk = 3, we'd get Reward = 0.3 lots. What kind of reward is that?

It's as I suspected - It's because I am SpreadBetting

In fact with position size = 0.01 and Reward/Risk = 3, we'd get Reward = 0.3 lots. The Reward would in fact be 0.03.

The Reward/Risk is in fact (in my instance) showing 3 to 1 odds

The PositionSize is the Bet size (stake)

That is when I bet 0.01 at 3/1 odds - If I win I will get 0.01*3 = 0.03 for my troubles

Sounds like SpreadBetting is going to be a special case

.
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
Embarrassed

There is an input parameter for that - DeleteLines. If you set it to true, the lines will be removed automatically when you remove or reload the indicator.

What a Fool I feel :eek:

No need for that too. You just need to make sure there is no TP line left from some of previous instances of the indicator and set the TakeProfitLevel input parameter to some reasonable value.

What a Fool I feel :eek:

.
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,619
1,366
144
Odesa
www.earnforex.com
It's as I suspected - It's because I am SpreadBetting

In fact with position size = 0.01 and Reward/Risk = 3, we'd get Reward = 0.3 lots. The Reward would in fact be 0.03.

The Reward/Risk is in fact (in my instance) showing 3 to 1 odds

The PositionSize is the Bet size (stake)

That is when I bet 0.01 at 3/1 odds - If I win I will get 0.01*3 = 0.03 for my troubles

Sounds like SpreadBetting is going to be a special case

.

Isn't then MoneyRisk = Position Size in your case?
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
My brain hurts

Isn't then MoneyRisk = Position Size in your case?

Quite possibly - The PositionSize (which I have re-named BetSize) is the amount of money I am betting - Although it's not the amount I stand to lose

That doesn't make sense

H'mmm - I am getting myself all confused with it now

On one hand YOU make sense

On the other hand I make sense

I think I had better go and have a lie down - My brain hurts

.
 

Maverick

Master Trader
Apr 3, 2014
453
6
79
Bournemouth UK
What do you mean?

You must have been in the room with me when I wrote that. I did go and check the front office only to find my suggestion already there. You Plonker Rodney .So I hurried back to delete my post. But not quick enough.

Speedy Gonzales (you) had already replied

.
 

glvrn

Trader
Jul 21, 2013
11
0
17
Hi Enivid,

I set rr_font_color to black but the display is yellow (see attachment).

Any ideas? Thanks!
 

Attachments

  • Untitled-1.png
    Untitled-1.png
    14.8 KB · Views: 14
Last edited:

glvrn

Trader
Jul 21, 2013
11
0
17
And also, just a suggestion. Is it possible to have an option (e.g. ShowBackground) that draws a solid colored box behind the text display? User can then choose a colour via BackgroundColor or something.:D
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,619
1,366
144
Odesa
www.earnforex.com
And also, just a suggestion. Is it possible to have an option (e.g. ShowBackground) that draws a solid colored box behind the text display? User can then choose a colour via BackgroundColor or something.:D
That would not be viable as it is nearly impossible to make the size of the background rectangle fit the text. It will be either too small or too large, interfering with the chart itself.
 
Status
Not open for further replies.