@jstap I can get the trade value of open trades and the value of the last closed trades. But how do I work out how much lot size to close.
e.g. I go 0.5 long, then 0.5 short.
The short trade closes out at say $100 in profit and the long trade is $150 in drawdown. I want to close out $80 of the trade in drawdown so I bank $20. How would you work out how much of the 0.50 lots to close out on the position in drawdown?
Posts made by btrader
-
RE: Close partially by amount of moneyposted in Questions & Answers
-
RE: Close partially by amount of moneyposted in Questions & Answers
Would also like to know how to do this. Anyone know a way to do the calculation?
-
Zero Divide Error With Brokers Using 1 Lot Minimumposted in Questions & Answers
Hi,
I have an EA which I built to trade stock indices and it works fine on all my normal brokers I use but there is one broker who forces you to use 1 lot increments and the EA just gives a 0 divide error. I've tested the EA on their FX pairs (allowing 0.01s) and it works fine so have narrowed it down to the fact they only allow 1.00 lots on the indices.
The error is thrown up in this line in the code generated by FXDreema:
size=MathRound(size/LotStep)*LotStep;
I assume thats to do with the lotstep but having searched through the forum for this Zero Divide error I can't find any solution that seems to work. Have a tried a few.
The EA doesn't use a stop loss and I even have it set to trade fixed lots and even when I set the lot size to 1 it still throws up the error.
Anyone have any ideas on a fix?
-
RE: Custom Code Conversion MT4 to MT5posted in Questions & Answers
@tipsywisdom That code makes the buttons work in the tester. It's a conversion from an MT4 EA built in FXDreema using the convertor to MT5. You didnt read the bloody post I posted did you. Suspect you are new

-
RE: Custom Code Conversion MT4 to MT5posted in Questions & Answers
Same error for each of the buttons.

-
Custom Code Conversion MT4 to MT5posted in Questions & Answers
I have just converted an MT4 project to MT5 using the convertor and all fine apart from some custom code I have to set button states after pressed in the tester.
I've used it in the MT4 version of an EA I'm building and it works perfectly.
Just converted my creation to MT5 and I get a compile error on all these blocks.What would be the MT5 version of this code?
ObjectSet(LoadedObjectName(),OBJPROP_STATE,0);The code is from this thread but think it's buried so deep people didnt see my question.

https://fxdreema.com/forum/topic/9883/working-buttons-in-strategytester
Any help much appreciated. -
RE: Working Buttons in StrategyTesterposted in Tutorials by Users
I have a question on this custom code for the buttons in the tester which sets the state after it's pressed.
I've used it in the MT4 version of an EA I'm building and it works perfectly.
Just converted my creation to MT5 and I get a compile error on all these blocks on the buttons.What would be the MT5 version of this code?
ObjectSet(LoadedObjectName(),OBJPROP_STATE,0); -
RE: Calculating ADR in pips Wrong for JPY Pairsposted in Questions & Answers
Anyone coming across this in the future I found the solution.
Searched for this but couldnt find it and stumbled across it while reading tutorials.
https://fxdreema.com/forum/topic/11003/atr-value-to-pips-tutorial/2
Handles JPY calculations perfectly. -
RE: Calculating ADR in pips Wrong for JPY Pairsposted in Questions & Answers
@roar So how would I implement that in the project?
https://fxdreema.com/shared/xZfhyTE4e
The modify variables there saves the ADR as a pip amount. Not sure how to use your formula, not a coder and just working visually with the system.
-
RE: Calculating ADR in pips Wrong for JPY Pairsposted in Questions & Answers
@roar I need an inpu to set a target which is an amount of pips but based off ADR.
i.e. half the ADR10 value if 50 would be 25. -
Calculating ADR in pips Wrong for JPY Pairsposted in Questions & Answers
Hi,
I'm creating an EA that uses ADR (average daily range) in it's strategy. I'm using the ATR for the daily candle to calculate this which is working fine.
I need the ADR figure in pips though and have worked out how to do that but my calculations dont work with JPY pairs as the digits are differnt.
This is the calculation I'm using.

Basically I get the ATR10 for the daily and *10,000. The raw ADR is shown on the chart and becomes a pip amount with my calculation. All good on pairs that have 5 digits.

With any JPY pair however with 3 digits the ADR raw is higher so my calculation is out. Need to be ATR * 1,000 NOT 10,000.

Is there a way to correct this or an easier way to achieve what I want?
Maybe an IF ESLE or something block I can use to store that variable differently by detecting if its an XXXJPY pair? -
Logic to detect hidden gapsposted in Questions & Answers
Hi,
I'm building an EA that works with grid trading and want to be able to detect and display propulsion candles that are not traded back into.
Like in the image below:

It's 3 candles. The gap is candle 2s body. The measurement starts at the high of candle 1 then the low of candle 3 cannot have traded back to the high of candle 1.
Need to output the top and bottom of that green block so I can use it as a target.
If it gets filled in needs deleting off the chart.
Any ideas if this is possible with fxDreema?
There are indicators out there that draw this (GapIndicator from Mql5 I am using) but none of them have output buffers unfortunately. -
RE: Any experts on fxDreema willing to build my EA for me?posted in Questions & Answers
@roar Thats a really complex EA!

Have tested it and it doesn't quite do what I want but dont think I've really explained it properly.EA Workflow (Short Example)
IF
Candle close is above 68 level on RSI (21 Median RSI).
THEN
Place a pending sell order 3 pips under the last DOWN candle low before the current high.
IF PENDING TRIGGERED
Place another pending sell at yesterdays high
(IF MORE THAN Β½ ADR10 ABOVE TRIGGERED SELL ORDER)
AND
Place another pending sell at the day before yesterdays high
(IF MORE THAN Β½ ADR10 ABOVE PENDING SELL ORDER AT YESTERDAYS HIGH)IF INITIAL PENDING NOT TRIGGERED
Repeat the above trailing the pending order up 3 pips under the last DOWN candle as new highs are formed until the pending is triggered.So when the pending triggers we should have a sell order and either 1 or 2 more
NO STOP LOSS IS USED.
TP should be set at 1X ADR10 below price.Reverse the above for buy orders.
-
RE: Any experts on fxDreema willing to build my EA for me?posted in Questions & Answers
@roar Holy crap.
Thats amazing! Will check that out and see how it works. I owe you a large beer I think! -
RE: Any experts on fxDreema willing to build my EA for me?posted in Questions & Answers
EA Workflow (Short Example)
X should be inputs where you see them below.IF
Price is above 68 level on RSI at close of candle last candle.
THEN
Pending sell order placed X pips under the last DOWN candles low before the current high.

IF
New highs are put in and order is not triggered trail pending order up underneath the DOWN candles as they are drawn in.
WHEN
Pending order is triggered enter 2 new pending sell orders at either
Previous days high, day befores high, day before thatβs high etc until you have 1 live order and 2 pending orders.
IF
The high is more than half ADR10 away from initial entry.NO STOP LOSS IS USED.
Reverse the above for buy orders using 32 on RSI and last DOWN cande instead of up.
TP set X times ADR10 (can set in inputs to be a multiple of this like 0.5, 1 etcβ¦)
-
RE: Any experts on fxDreema willing to build my EA for me?posted in Questions & Answers
That would be awesome. What would you need?
-
Any experts on fxDreema willing to build my EA for me?posted in Questions & Answers
I really want to use this system to build and get the basics of my EA idea working but am struggling to build it.
I have a simple workflow of the logic I want and have played around but cannot really find the bits I need or get them in the righ order.
Probably way too complex for me!
Happy to pay someone.