Trading Panel with auto lot size - page 2

 
Zixu Li #I call this function OnInit() . The system does not generate it's own error, no trade are opened.
Never call trade functionality in the OnInit(). Wait for the first tick to arrive and handle it in the OnTick() event handler.
 
Fernando Carreiro #:
Never call trade functionality in the OnInit(). Wait for the first tick to arrive and handle it in the OnTick() event handler.

I made a button called Trade too, and when pressed it returns the same error.


void QCPositionSizeCalculator::OnClickBtnTrade() {
  
  OpenTrade();
}
 
Zixu Li #:I made a button called Trade too, and when pressed it returns the same error.

Forum on trading, automated trading systems and testing trading strategies

Trading Panel with auto lot size

Fernando Carreiro, 2025.01.10 14:17

Please identify which lines give the error and show the log output.
 
Fernando Carreiro #:
GM 0 21:40:15.534 TradeMan (NDX100,H1) Trying to save settings to file: PSC_NDX100132042793237345258.txt.
ML 0 21:40:15.534 TradeMan (NDX100,H1) Saved settings successfully.
HK 0 21:40:15.586 TradeMan (NDX100,H1) OrderSend error 4014

Line 411 of PositionSizeCalculator.mq5

 
Zixu Li #: Line 411 of PositionSizeCalculator.mq5

In my post #5, I asked if you were running your code inside an indicator, and in your post #7, you stated that you were running your code in EA.

Now I see that you did not tell us the truth. Your file "PositionSizeCalculator.mq5" is an Indicator, not an EA.

Indicators cannot carry out trading, hence the error 4014.

 
Fernando Carreiro #:

In my post #5, I asked if you were running your code inside an indicator, and in your post #7, you stated that you were running your code in EA.

Now I see that you did not tell us the truth. Your file "PositionSizeCalculator.mq5" is an Indicator, not an EA.

Indicators cannot carry out trading, hence the error 4014.

Thanks, I have installed it in the EA section and the website says EA too [redacted]

So if I convert it to an EA, it should work ya?

I was using ver 2.9, but it mentioned it was an EA, good that there is a new version now which is an EA. I shall test it. Thank you so much.

 
Zixu Li #: Thanks, I have installed it in the EA section and the website says EA too [redacted]. So if I convert it to an EA, it should work ya? I was using ver 2.9, but it mentioned it was an EA, good that there is a new version now which is an EA. I shall test it. Thank you so much.

Discussions about 3rd party products and services are not allowed on the forum. Please do your own research.

 
Fernando Carreiro #:

Discussions about 3rd party products and services are not allowed on the forum. Please do your own research.

Noted with thanks, the funny thing is that I am able to load the panel and see the correct values when I put the source code under EA.