I need help in assigning functions as variable values - page 3

 

Yes you're right. now I get it, since there will be another order 80pips away, we can automatically refer to it as 80 pips stop loss since the trade will turn to an hedge by the time it moves 80pips against the open position. I think new straddle for each new day despite profits or loss will be better.

To assess the profitability of this strategy, I was thinking of the possibility of an EA that can calculate the pip difference between the high and the open of bearish candles and the low and open of bullish candles

this will give the idea of the average deviation of price from the open before the market picks its direction for the day The user defined variables bieng timeframe and current chart symbol does such ea exist?

 
0808 wrote >>

Yes you're right. now I get it, since there will be another order 80pips away, we can automatically refer to it as 80 pips stop loss since the trade will turn to an hedge by the time it moves 80pips against the open position. I think new straddle for each new day despite profits or loss will be better.

To assess the profitability of this strategy, I was thinking of the possibility of an EA that can calculate the pip difference between the high and the open of bearish candles and the low and open of bullish candles

this will give the idea of the average deviation of price from the open before the market picks its direction for the day The user defined variables bieng timeframe and current chart symbol does such ea exist?

To calculate pip difference

if (Open[1]>Close[1]) //bearish prev timeframe candle

PipDiff= (High[1]-Open[1])/Point;

else PipDiff=(Open[1]-Low[1])/Point; //for bullish prev timeframe candle

now what do you do with PipDiff which gives the deviation of price in pips value?

 

Knowing the pip difference will give us an idea of the number of pips price move away from the direction it will move for each day before eventually going in the direction.

since this strategy is based on the first candle of the day we will want to know the appropriate gap we should leave away from point X before setting our pending orders

 

Please I still need help closing these orders, before each new straddle for each new day all pending and working orders must be closed, now the pending orders can be closed with the expiration date function

but what of the working orders that has been executed?

 
0808 wrote >>

Please I still need help closing these orders, before each new straddle for each new day all pending and working orders must be closed, now the pending orders can be closed with the expiration date function

but what of the working orders that has been executed?

does this look right?

1 2008.01.03 01:00 buy stop 1 0.10 1.4760 1.4640 1.4800 0.00 10000.00
2 2008.01.03 01:00 sell stop 2 0.10 1.4680 1.4800 1.4640 0.00 10000.00
3 2008.01.03 10:54 buy 1 0.10 1.4760 1.4640 1.4800 0.00 10000.00
4 2008.01.04 00:00 close 1 0.10 1.4744 1.4640 1.4800 -15.67 9984.33
5 2008.01.04 00:01 delete 2 0.10 1.4680 1.4800 1.4640 0.00 9984.33
6 2008.01.04 01:00 buy stop 3 0.10 1.4785 1.4665 1.4825 0.00 9984.33
7 2008.01.04 01:00 sell stop 4 0.10 1.4705 1.4825 1.4665 0.00 9984.33
8 2008.01.04 07:57 sell 4 0.10 1.4705 1.4825 1.4665 0.00 9984.33
9 2008.01.04 13:31 buy 3 0.10 1.4785 1.4665 1.4825 0.00 9984.33
10 2008.01.04 14:07 s/l 4 0.10 1.4825 1.4825 1.4665 -120.00 9864.33
11 2008.01.07 00:00 close 3 0.10 1.4746 1.4665 1.4825 -38.67 9825.66
12 2008.01.07 01:00 buy stop 5 0.10 1.4783 1.4663 1.4823 0.00 9825.66
13 2008.01.07 01:00 sell stop 6 0.10 1.4703 1.4823 1.4663 0.00 9825.66
14 2008.01.07 02:41 sell 6 0.10 1.4703 1.4823 1.4663 0.00 9825.66
15 2008.01.07 07:59 t/p 6 0.10 1.4663 1.4823 1.4663 40.00 9865.66
16 2008.01.07 07:59 delete 5 0.10 1.4783 1.4663 1.4823 0.00 9865.66
17 2008.01.08 01:00 buy stop 7 0.10 1.4724 1.4604 1.4764 0.00 9865.66
18 2008.01.08 01:00 sell stop 8 0.10 1.4644 1.4764 1.4604 0.00 9865.66
19 2008.01.08 07:08 buy 7 0.10 1.4724 1.4604 1.4764 0.00 9865.66
20 2008.01.09 00:00 close 7 0.10 1.4705 1.4604 1.4764 -18.67 9846.99
21 2008.01.09 00:00 delete 8 0.10 1.4644 1.4764 1.4604 0.00 9846.99
22 2008.01.09 01:00 buy stop 9 0.10 1.4751 1.4631 1.4791 0.00 9846.99
23 2008.01.09 01:00 sell stop 10 0.10 1.4671 1.4791 1.4631 0.00 9846.99
24 2008.01.09 13:09 sell 10 0.10 1.4671 1.4791 1.4631 0.00 9846.99
25 2008.01.10 00:13 delete 9 0.10 1.4751 1.4631 1.4791 0.00 9846.99
26 2008.01.10 00:14 close 10 0.10 1.4666 1.4791 1.4631 1.64 9848.63
27 2008.01.10 01:00 buy stop 11 0.10 1.4712 1.4592 1.4752 0.00 9848.63
28 2008.01.10 01:00 sell stop 12 0.10 1.4632 1.4752 1.4592 0.00 9848.63
29 2008.01.10 14:37 buy 11 0.10 1.4712 1.4592 1.4752 0.00 9848.63
30 2008.01.10 17:18 t/p 11 0.10 1.4752 1.4592 1.4752 40.00 9888.63
31 2008.01.10 17:18 delete 12 0.10 1.4632 1.4752 1.4592 0.00 9888.63

 
ronaldosim:

does this look right?

1 2008.01.03 01:00 buy stop 1 0.10 1.4760 1.4640 1.4800 0.00 10000.00
2 2008.01.03 01:00 sell stop 2 0.10 1.4680 1.4800 1.4640 0.00 10000.00
3 2008.01.03 10:54 buy 1 0.10 1.4760 1.4640 1.4800 0.00 10000.00
4 2008.01.04 00:00 close 1 0.10 1.4744 1.4640 1.4800 -15.67 9984.33
5 2008.01.04 00:01 delete 2 0.10 1.4680 1.4800 1.4640 0.00 9984.33
6 2008.01.04 01:00 buy stop 3 0.10 1.4785 1.4665 1.4825 0.00 9984.33
7 2008.01.04 01:00 sell stop 4 0.10 1.4705 1.4825 1.4665 0.00 9984.33
8 2008.01.04 07:57 sell 4 0.10 1.4705 1.4825 1.4665 0.00 9984.33
9 2008.01.04 13:31 buy 3 0.10 1.4785 1.4665 1.4825 0.00 9984.33
10 2008.01.04 14:07 s/l 4 0.10 1.4825 1.4825 1.4665 -120.00 9864.33
11 2008.01.07 00:00 close 3 0.10 1.4746 1.4665 1.4825 -38.67 9825.66
12 2008.01.07 01:00 buy stop 5 0.10 1.4783 1.4663 1.4823 0.00 9825.66
13 2008.01.07 01:00 sell stop 6 0.10 1.4703 1.4823 1.4663 0.00 9825.66
14 2008.01.07 02:41 sell 6 0.10 1.4703 1.4823 1.4663 0.00 9825.66
15 2008.01.07 07:59 t/p 6 0.10 1.4663 1.4823 1.4663 40.00 9865.66
16 2008.01.07 07:59 delete 5 0.10 1.4783 1.4663 1.4823 0.00 9865.66
17 2008.01.08 01:00 buy stop 7 0.10 1.4724 1.4604 1.4764 0.00 9865.66
18 2008.01.08 01:00 sell stop 8 0.10 1.4644 1.4764 1.4604 0.00 9865.66
19 2008.01.08 07:08 buy 7 0.10 1.4724 1.4604 1.4764 0.00 9865.66
20 2008.01.09 00:00 close 7 0.10 1.4705 1.4604 1.4764 -18.67 9846.99
21 2008.01.09 00:00 delete 8 0.10 1.4644 1.4764 1.4604 0.00 9846.99
22 2008.01.09 01:00 buy stop 9 0.10 1.4751 1.4631 1.4791 0.00 9846.99
23 2008.01.09 01:00 sell stop 10 0.10 1.4671 1.4791 1.4631 0.00 9846.99
24 2008.01.09 13:09 sell 10 0.10 1.4671 1.4791 1.4631 0.00 9846.99
25 2008.01.10 00:13 delete 9 0.10 1.4751 1.4631 1.4791 0.00 9846.99
26 2008.01.10 00:14 close 10 0.10 1.4666 1.4791 1.4631 1.64 9848.63
27 2008.01.10 01:00 buy stop 11 0.10 1.4712 1.4592 1.4752 0.00 9848.63
28 2008.01.10 01:00 sell stop 12 0.10 1.4632 1.4752 1.4592 0.00 9848.63
29 2008.01.10 14:37 buy 11 0.10 1.4712 1.4592 1.4752 0.00 9848.63
30 2008.01.10 17:18 t/p 11 0.10 1.4752 1.4592 1.4752 40.00 9888.63
31 2008.01.10 17:18 delete 12 0.10 1.4632 1.4752 1.4592 0.00 9888.63

Yes! thanks, that's exactly what the program should achieve the only area I think should be adjusted is the sl to be 80 pips for each order

 
0808 wrote >>

Yes! thanks, that's exactly what the program should achieve the only area I think should be adjusted is the sl to be 80 pips for each order

ok, great. i will clean up the codes, test it again before i send it to you.

 
Thanks so much I'm expectant
 
0808 wrote >>
Thanks so much I'm expectant

The EA you wanted is in your PM

Reason: