Looks like you are calling with the actual object for curPosition instead of the pointer.
If you look at the documentation for CheckTrailingStopLong you can see how it should be called.
So in your code it should be something like:
if(curPosition.Select(Symbol())) { if(curPosition.PositionType()==POSITION_TYPE_BUY) trailingStop.CheckTrailingStopLong(GetPointer(curPosition), curPosition.StopLoss(), curPosition.TakeProfit()); if(curPosition.PositionType()==POSITION_TYPE_SELL) trailingStop.CheckTrailingStopShort(GetPointer(curPosition), curPosition.StopLoss(), curPosition.TakeProfit()); } return true;
Looks like you are calling with the actual object for curPosition instead of the pointer.
If you look at the documentation for CheckTrailingStopLong you can see how it should be called.
So in your code it should be something like:
Sorry missed the curPosition StopLoss() and TakeProfit() calls, they return a const double. Take another look at the documentation for how it should be done.
I'm not sure what you are trying to do, you don't it looks like you are duplicating the purpose of CheckTrailingStop()
So looks like you could just call
trailingStop.CheckTrailingStop()
Sorry missed the curPosition StopLoss() and TakeProfit() calls, they return a const double. Take another look at the documentation for how it should be done.
I'm not sure what you are trying to do, you don't it looks like you are duplicating the purpose of CheckTrailingStop()
So looks like you could just call
Sorry missed the curPosition StopLoss() and TakeProfit() calls, they return a const double. Take another look at the documentation for how it should be done.
I'm not sure what you are trying to do, you don't it looks like you are duplicating the purpose of CheckTrailingStop()
So looks like you could just call
and yours trailingStop.CheckTrailingStop() is not defined I think i have there much bigger problem with understanding the whole concept, idea of OOP, Im not good in programing
i have read wrong your comment i tried trailingStop.CheckTrailingStopLong(); without parameters
and yours trailingStop.CheckTrailingStop() is not defined I think i have there much bigger problem with understanding the whole concept, idea of OOP, Im not good in programing
}
You should agree the type of obj "bool"
Why are you replying to a 10 year old topic?
Don't bring old topics to the top for no good reason.
Please edit your post and use the code button (Alt+S) when pasting code.
EDIT your original post, please do not just post the code correctly in a new post.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I try to use trailing stop but get error
'CheckTrailingStopLong' - no one of the overloads can be applied to the function call
'CheckTrailingStopShort' - no one of the overloads can be applied to the function call