this bit of code doesnt seem to buy, any ideas why?
{
OrderSend(Symbol(),OP_BUY,lots,Ask,3,stop,Ask+profit,"",2005,0,Green);
}I think it should be:
{
ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,3,stop*Point,Ask+profit*Point,"",2005,0,Green);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
Print("BUY order opened : ",OrderOpenPrice());
}
else Print("Error opening BUY order : ",GetLastError());
return(0);
}that worked, very much appreciated, but why the "ticket", "orderselect" and "Point" x ask+profit?, i'm reading through your tutorials atm, i apologise if i missed this info. thanks again.
You're welcome!
that worked, very much appreciated, but why the "ticket" and "orderselect" i'm reading through your tutorials atm, i apologise if i missed this info. thanks again.
3- I've changed stop to stop*Point and profit to profit*Point.[/left]
why does point need to be a part of the code?
i've also noticed that my stoploss is set to 30 and my take profit is 80, yet my backtest results give me around 17 loss and 45 profit, why does it do this? thanks again.
Point
why does point need to be a part of the code?
Pointfunction returns the point size of the current symbol.
(EX: if you trade EURUSD the point value = .0001 and if you trade EURJPY the point value should be .01)
So, if your stoplossmust be converted to points in order to use OrderSendor OrderModifyfunctions.
Could you explain more? Do you mean that the strategy tester automatically set your stoploss and takeprofit values?
Pointfunction returns the point size of the current symbol.
(EX: if you trade EURUSD the point value = .0001 and if you trade EURJPY the point value should be .01)
So, if your stoplossmust be converted to points in order to use OrderSendor OrderModifyfunctions."Ask+profit*Point" should be equal to whatever i set my profit level at right?, but if "ask" is 1.1825 and "profit" is 50 then "1.1825+80*1.1825" but that equals 95
Could you explain more? Do you mean that the strategy tester automatically set your stoploss and takeprofit values?
my expert has the below settings as default
extern double profit = 80;
extern double stop = 30;
but backtesting produced t/p stops of 45-46 and stoploss losses of 17
"Ask+profit*Point" should be equal to whatever i set my profit level at right?, but if "ask" is 1.1825 and "profit" is 50 then "1.1825+80*1.1825" but that equals 95
No, the Point will be .0001 not 1.1825 (1.1825 is the ask price).
So,
If "ask" is 1.1825 and "profit" is 50then:
1.1825 + (50 * .0001) = 1.1825 + 0.005 = 1.1875 (50 Pips)
extern double profit = 80;
extern double stop = 30;
but backtesting produced t/p stops of 45-46 and stoploss losses of 17Still don't understand this point .
Did you use Optimizationtesting mode?
maybe this will help,
Parameters profit=80; stop=30;
yet niether the t/p or s/l are the same as the specified
does no one have any ideas why the results are as shown in the test run?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
this bit of code doesnt seem to buy, any ideas why?
{
OrderSend(Symbol(),OP_BUY,lots,Ask,3,stop,Ask+profit,"",2005,0,Green);
}it should buy when a new candle closes above the moving average and the previous closed below it.