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

Moving Day
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5801
Page 18 of 18
Author:  Maximilian [ Tue Apr 27, 2021 2:12 pm ]
Post subject:  Moving Day

Thanks for your explanations @biobier @Tomele.
Greetings,
Maximilian
Author:  SteveHopwood [ Tue Apr 27, 2021 2:12 pm ]
Post subject:  Moving Day

I have added the fix that Max spotted and uploaded to post 1. Thanks Max. :clap: :clap: :clap:

DIYers, do a search for:int levels = (int) (lossPips / distanceBetweenTrades);

Replace it with:
int levels = (int) (lossPips / DistanceBetweenLevels);

Re my thingy of declaring some externals and integers and then copying the input into a double for use throughout the code, it is all to do with the confusion initially caused when the brokers added an extra digit to the quote price. Many confused pips with points.

Anything input that needs a pips entry I end with 'Pips', making it explicit so:
extern int StopLossPips = 20;
double stopLoss=0;
Then in OnInit:
stopLoss=StopLossPips;

This saves me from getting cross because I do not need to constantly reiterate the difference between pips and points.

:xm: :rocket:
Author:  Maximilian [ Tue Apr 27, 2021 2:15 pm ]
Post subject:  Moving Day

SteveHopwood wrote:I have added the fix that Max spotted and uploaded to post 1. Thanks Max. :clap: :clap: :clap:

DIYers, do a search for:int levels = (int) (lossPips / distanceBetweenTrades);

Replace it with:
int levels = (int) (lossPips / DistanceBetweenLevels);

Re my thingy of declaring some externals and integers and then copying the input into a double for use throughout the code, it is all to do with the confusion initially caused when the brokers added an extra digit to the quote price. Many confused pips with points.

Anything input that needs a pips entry I end with 'Pips', making it explicit so:
extern int StopLossPips = 20;
Then in OnInit:
stopLoss=StopLossPips;

This saves me from getting cross because I do not need to constantly reiterate the difference between pips and points.

:xm: :rocket:
I see. Thanks Steve.
Maximilian
All times are UTC Page 18 of 18