Topics
Replies
cprcrack
28 Feb 2015, 21:19
By returning and accepting only double parameters in the API, you are encouraging the API consumer to use doubles itself, which can lead to problems. For example, this is how you could calculate the pips of a just closed position:
Pips: (closePrice - entryPrice) / Symbol.PipSize
Pips in double: (1.18013 - 1.17913) / 0.0001 = 9.999999999998899
Pips in decimal: (1.18013M - 1.17913M) / 0.0001M = 10
However I prefer double if there's a performance reason behind.
@cprcrack
cprcrack
19 Feb 2015, 14:45
A simple backtest with tick timeframe and tick data from 1/10/2014 to 10/10/2014 (10 days) brings the following results:
- Total ticks: 878872
- Total bars: 586469
However the same backtest with 1m timeframe and 1m data for the same period brings the following result as expected:
- Total ticks: 11278
- Total bars: 11278
I need to understand this discrepancy for the development of my bot.
@cprcrack
cprcrack
19 Feb 2015, 13:22
I understand that if the stop loss is invalid it won't be applied, but here I'm talking about a modification of a currently valid stop-loss order. Do you mean that if the stop loss modification is not valid, it will return that error and the previous price of the stop loss will be kept?
@cprcrack
cprcrack
18 Feb 2015, 14:49
It's somehow inconsistent because with ExecuteMarketOrder() you must specify relative pips, but with ModifyPosition() you must specify a price.
Also, one of the side effects of specifying relative pips in ExecuteMarketOrder() is that if the current spread is bigger than the stop loss pips, your stop loss will fire immediately after the ExecuteMarketOrder() call, and you will lose money with that order (- spread - commissions +/- slippage).
@cprcrack
cprcrack
17 Feb 2015, 09:34
This is a must for scalping. For example you may want to set the grids to a fixed 2 pips, because it's your expected profit per trade. So with this feature you could set the grids to 2 pips of height, and in that way you can visually see how easy or hard you have to make that gap.
@cprcrack
cprcrack
09 Apr 2015, 15:04
You should really improve this color stuff, custom easy to use colors everywhere is a must.
@cprcrack