1. Additional update....Removing the code seems to have Hidden S/L working.....but do see Error 4111 ...Also as this is using Martingale type and the lotsi = .10 The lot sizes on FXDD only allow .10, .20, .30 .40 etc.....and I'd like to have the progression not at double but just at 1.4 or 1.5 times. ie. .10, .14, .19, .27 I know they don't allow it at FXDD so I'd like to have the code to round off the 1.4 lotsi multipier to actually Ordersend first order .10, second order .10, third order .20, fourth order .30, fifth order .50, etc.

This doubles it

lotsi = 0.1;
else
lotsi = 2.0*max_lot_s;

and if FXDD would allow it this would increase it by 1.4

lotsi = 0.1;
else
lotsi = 1.4*max_lot_s;

but they don't and double is too much!
Can you help? Thanks
Bill

2. Originally Posted by BillR
Additional update....Removing the code seems to have Hidden S/L working.....but do see Error 4111 ...Also as this is using Martingale type and the lotsi = .10 The lot sizes on FXDD only allow .10, .20, .30 .40 etc.....and I'd like to have the progression not at double but just at 1.4 or 1.5 times. ie. .10, .14, .19, .27 I know they don't allow it at FXDD so I'd like to have the code to round off the 1.4 lotsi multipier to actually Ordersend first order .10, second order .10, third order .20, fourth order .30, fifth order .50, etc.

This doubles it

lotsi = 0.1;
else
lotsi = 2.0*max_lot_s;

and if FXDD would allow it this would increase it by 1.4

lotsi = 0.1;
else
lotsi = 1.4*max_lot_s;

but they don't and double is too much!
Can you help? Thanks
Bill
You have to use the NormalizeDouble function.

In OrderSend(..., replace lotsi by :

NormalizeDouble(lotsi,2)

3. Hi Funyoo,
When testing the Hidden Stoploss I used Longs only....when testing Shorts only I don't get any orders generated. I don't think the error is in the Hidden code you entered....I believe it to be somewhere else in the code. Do you see my error?
Thanks again, Bill

4. Originally Posted by BillR
Hi Funyoo,
When testing the Hidden Stoploss I used Longs only....when testing Shorts only I don't get any orders generated. I don't think the error is in the Hidden code you entered....I believe it to be somewhere else in the code. Do you see my error?
Thanks again, Bill
Strange, it works for me.

5. Thanks Funyoo,
When Backtesting Shorts "ONLY" it doesn't work....when testing "Long and Short", or "Longs only" it works great. The Double Normalize worked fine too.... I will be " Buying Funyoo coffee" at the top of the page....I really appreciate your sharing and teaching. Thanks again, Bill

6. Funyoo,
Do you see the error 4111 ??
Thanks Bill

7. Originally Posted by BillR
Funyoo,
Do you see the error 4111 ??
Thanks Bill
Yes, you can ignore it. That means that shorts are not allowed (due to the expert properties).

8. Hi Funyoo,
I'm not sure why....but I can only get it to work if the multiplier is 1.5. (or 2) It just creates orders for .10 when I change the number of either the

else
lotsi = 1.5*max_lot_b;

and/or the

" ", m, 0, Yellow);

to 1.4....or 1.3, 1.2 etc
(I'm also changing the OrderSend Op_Sell)

Were you also able find the error in the "Shorts ONLY" true not creating any orders??

Thanks again for teaching/helping!!
Bill

9. Originally Posted by BillR
Hi Funyoo,
I'm not sure why....but I can only get it to work if the multiplier is 1.5. (or 2) It just creates orders for .10 when I change the number of either the

else
lotsi = 1.5*max_lot_b;

and/or the

" ", m, 0, Yellow);

to 1.4....or 1.3, 1.2 etc
(I'm also changing the OrderSend Op_Sell)

Were you also able find the error in the "Shorts ONLY" true not creating any orders??

Thanks again for teaching/helping!!
Bill
Hi BillR,

Yes me too. The code tries to enter first a buy order.

Instead of using the expert properties, you should use booleans directly in the code :

extern bool OnlySell=true;

Then :

if(OnlySell)OrderSend(Symbol(), OP_SELL...

For the multiplier, it comes certainly from the broker as it works for me.

10. Hi Funyoo,
Yes, I believe the "Multiplier" to be broker dependent....FXDD "Demo" allows anything, but the "Live" account restricts....
I'll read up/experiment on using extern bool.
Is this the proper syntax??
(I assume in order for the program to work both "Shorts" and "Longs" you'd have to now say "True" for both "Longs Only" AND "Shorts Only".

" ", m, 0, Yellow);

tic = if(OnlySell)OrderSend(Symbol(), OP_SELL, NormalizeDouble(lotsi,1.5), Bid, slip, Bid + (sl)*Point, Bid - (tp + 25)*Point,
" ", m, 0, Red);

Thanks again,
Bill