You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hey, you're right, sorry for being vague! I will try to be a lot more specific from now on when asking for help. Here are some prints:
In connection to your last line above^ - Why would it not close out the correct lot sizing when my lots open were 0.58...? Also, if I had 0.03 lots open, and I am trying to divide by 4, is there a way to create a formula so that it closes the closest plausible lot value ? I.e. rounding it up?
Of course there are many ways to handle 0.3 lots, but you are the best person to understand your strategy and what fits best within the strategy, coding comes later . . . figure out what you want to do to handle this instance that will also work with all other scenarios . . . think about it some more to make sure you haven't missed something . . . then, eventually, code it.
Ok cool.
I already know exactly what I want in terms of how the positioning should be closed. Problem is, I do not know how to write the code. Here's an example:
Lots: 0.33
First target (1:1): 0.33 / 4 = 0.0825 -- Does my code round that to 0.08?
Second Target(2:1): 0.25 / 1.5 = 0.166666... --- Again, will this close 0.16?
Third Exit (Close below EMA): 0.09 / 2 = 0.045 --- Close 0.04?
Rest closes out from a trailing stop... assuming these positions closed in consecutive order. The areas in bold are user defined.
The question is, the formula "double Target_2 = MathFloor( ( OrderLots() / Second_Target ) / lotStep) * lotStep;" from the first page, does this technically work on numbers like I have mentioned in the example above?