Please Help I have a script but it is not placing trade. Can someone help

Jul 6, 2023
7
0
1
52
Please Help I have a script but it is not placing trade. Can someone help?

The script is expected to be used to trade during news period.

The script is expected to do the following.
1. Scan the market to get the difference between the bid and ask prices (Spread) at a set time of 1 to 5minutes before the news is released.

2. Deduct the spread to the current ask price to give SELL STOP. 5 or more sell stop pending trades will be placed with same sell stop price and stop loss of about 10 to 20pips and Take Profit of 100, 200,. 300. 400 and 500pips/point respectively. Including Slippage and trailing Stop

3.
Add the spread to the current bid price to give BUY STOP. 5 or more buy stop pending trades will be placed with same buy stop price and stop loss of about 10 to 20pips and Take Profit of 100, 200,. 300. 400 and 500pips/point respectively. Including Slippage and trailing Stop
4. Other pendings trades will be closed.

Please someone help me.
 
First, this is not a script, this is EA.
Second, for some reason it has two OnTick() functions, which isn't good.
Third, it will try to place its stop orders every tick.
Fourth, it will always fail to place them because it attempts to place a stop order on the current price. Stop orders should be placed at a distance (called stop level) to the current price.
 
First, this is not a script, this is EA.
Second, for some reason it has two OnTick() functions, which isn't good.
Third, it will try to place its stop orders every tick.
Fourth, it will always fail to place them because it attempts to place a stop order on the current price. Stop orders should be placed at a distance (called stop level) to the current price.
Thanks for your observations I guess that is why it is not placing trade. Am not aware of the stop-order I used spread difference plus current price for buy and sell stop.


Kindly assist using the stop order level for the pending trades but Will the stop order too much. Please you can aid to make it work.
 
Thanks for your observations I guess that is why it is not placing trade. Am not aware of the stop-order I used spread difference plus current price for buy and sell stop.


Kindly assist using the stop order level for the pending trades but Will the stop order too much. Please you can aid to make it work.
You aren't using spread to set the stop price in the attached code. You are using Ask price for buy stop and Bid price for sell stop. Please check out the built-in help file on MODE_STOPLEVEL. This will help you to code it so that the stop order is placed as close to the current price as possible.
 
You aren't using spread to set the stop price in the attached code. You are using Ask price for buy stop and Bid price for sell stop. Please check out the built-in help file on MODE_STOPLEVEL. This will help you to code it so that the stop order is placed as close to the current price as possible.
Thanks for your quick response.
Can you assist me or introduce someone very good to help me.