The spread is irrelevant to the stop limit price. If you set a buy order at 100 and the range at 2, then what you are asking is the slippage not to exceed 2. Therefore the worst executed price will be 102 and only the volume that can fulfill this requirement will be filled. The spread is irrelevant, the bid price can be at 99 or 50.
Regarding TP, it can only be set in relative pips at the moment. If you need to set an exact price, you would have to modify the opened position.
It will be hard to get help by just throwing dozens of lines of code and ask for people why it doesn't work. This is because readers don't know what you expect the code to do and what it does instead. Even if they spend time interrogating you, then they will need to spend hours to figure out what you did wrong in your logic. Not many people have this surplus of time.
Did you try debugging your strategy first? Did you place a break point at the line where the conditions are evaluated to check what are the values when a trade is expected to be placed? It will help you understand why the trade is not placed when you expect it to do so.
You need to narrow down the problem to a question that can be answered by somebody in 10-15 minutes before asking for help.
We didn't have any similar reports. Did you try debugging your cBot i.e. adding logs and understand what happens after this first week? Did you try comparing by executing using your own VPS? Is there a difference in execution?
Many people think that stop limit orders somehow improve execution and magically eliminate slippage. They don't. They only thing a stop limit order does is that it does not execute the part of the order that falls beyond the slippage you can tolerate. This is what happens in your case. The stop limit order did what you instructed it to do. It did not execute the order because it could not meet your slippage criteria. If you want your orders to be executed, just use market orders.
Exactly the same problem, see RSI indicator below. Happen in yesterday's update, and still happens in today's update.
Hi, Unortunately, new version of cTrader change bahvior of memory management for Calculate() method. :( In you case indicator MACD Crossover need to be removed or method Calculate(int index) modified accordingly . If you don't know how to fix Calculate(int index), you will need to remove MACD Crossover indicatior, and most probably other custom indicators you are using. UPDATE: Seems that cTrader in version 5.0.38 introduced yesterday fix memory management issues, but I'm still testing.
Hi there,
We have released a hotfix (5.0.38). Can you please advise if it resolves your issue?
Bars are not time based but tick based. Therefore the OnBar() method will be triggered when the new tick for that time range arrives. So if the tick comes 10 seconds after the previous bar was supposed to be closed, the OnBar method will be triggered with 10 seconds delay. If no tick arrives within that timeframe, then no bar will be formed.
If you want to close an existing position, fully or partially, using FIX API, you need to use the New Order Single (MsgType(35)=D) message to send an order of the opposite direction and specify the position you want to modify in PosMaintRptID.
PanagiotisCharalampous
04 Oct 2024, 05:33
Hi there,
The spread is irrelevant to the stop limit price. If you set a buy order at 100 and the range at 2, then what you are asking is the slippage not to exceed 2. Therefore the worst executed price will be 102 and only the volume that can fulfill this requirement will be filled. The spread is irrelevant, the bid price can be at 99 or 50.
Regarding TP, it can only be set in relative pips at the moment. If you need to set an exact price, you would have to modify the opened position.
Best regards,
Panagiotis
@PanagiotisCharalampous