Questions from Beginners MQL5 MT5 MetaTrader 5 - page 340

 
Tapochun:
If you want to post the source, attach the .mq5 file, not the compiled version (.ex5)
oops....... thanks updated to mq5
 
aleks557:
ops....... thanks updated to mq5

Warning 1: replace D' with 0 or __DATETIME__ - set the correct value yourself!

Warning 2: you need to add a pair of brackets in the line there (see attached file);

Warnings 3-5: in switch statement add default case (see attached file) - fix in file by yourself!

Warnings 6: add line #property indicator_plots 0 (no graphical series) (see attached file);

Files:
 
Tapochun:

Warning 1: replace D' with 0 or __DATETIME__ - set the correct value yourself!

Warning 2: you need to add a pair of brackets in the line there (see attached file);

Warnings 3-5: in switch statement add default case (see attached file) - fix in file by yourself!

Warnings 6: add line #property indicator_plots 0 (no graphical series) (see attached file);

thanks a lot ,

I'm so nervous I'm guessing.

I think the contrast is a little clearer.

I wanted to find out more about the code: I want to check if it shows the daily candle pattern, can I make it show the pattern of the candle I want to show in the settings?

 
aleks557:

Thanks for reading,

I was so nervous, I was just guessing.

I think the contrast is a little clearer.

There's something else I wanted to find out about the code: I want to check if it shows the daily candle pattern, can I make it show the pattern of the candle I want to show in the settings?

You can do anything you want...)
 

Why did my two short positions close on their own without the market closing.

two positions were bought at 216.

Take profit was set at 150,

closed at 211, even though the price went down to 200

margin 1:1

As if, after some time mt4 closed the positions itself, after the time I turned off the laptop.

 
jedi108:

Why did my two short positions close on their own without the market closing.

two positions were bought at 216.

Take profit was set at 150,

closed at 211, even though the price went down to 200

margin 1:1

As if, after some time mt4 closed the positions itself, after the time I turned off my laptop.

Please clarify your question:

1. Which terminal: mt4 or mt5.

2. You need a screenshot from "History" tab - for MT5 or from "Account History" tab - for MT4.

3. Logbook entries.

 
barabashkakvn:

Please clarify your question:

1. Which terminal: MT4 or MT5.

2. You need a screenshot from the "History" tab for MT5 or from the "Account History" tab for MT4.

3. Logbook entries.

1. mt4

2. screenshot

3. my account

 
jedi108:

Why did my two short positions close on their own without the market closing.

two positions were bought at 216.

Take profit was set at 150,

closed at 211, even though the price went down to 200

margin 1:1

As if, after some time mt4 closed the positions itself, after the time I turned off the laptop.

Have you subscribed to a signal and it's not copying correctly? You need the log entries from the terminal.
 
jedi108:

Why did my two short positions close on their own without the market closing.

two positions were bought at 216.

Take profit was set at 150,

closed at 211, even though the price went down to 200

margin 1:1

As if, after some time mt4 closed the positions itself, after the time i switched off the laptop.

Please read the help from the terminal - what is a Take Profit order:

  • Take Profit
    Take Profit order is intended for gaining the profit when the price of financial instrument reaches the forecasted level. Execution of this order leads to closing of a position. It is always related to an open position or a pending order. The order can be given only together with a market or a pending order. When checking the condition of this order for long positions the Bid price is used (the order is always set higher than the current Bid price), and when checking short positions the Ask price is used (the order is always set lower than the current Ask price).
 
barabashkakvn:

from the terminal

from the terminal screenshothere
Files:
btcusd2.jpg  151 kb
Reason: