Coding Problem?? or FXDreema bug??
-
I have two similar codes, for Average buys and Average sells.
For some reason the calculation gets mixed-up somewhereGroup1
Code for the buys: double lots = PositionGetDouble(POSITION_VOLUME);
double openlvl = PositionGetDouble(POSITION_PRICE_OPEN);v::average_Buys = v::average_Buys + lots/v::total_lots*openlvl;
}
};
Group2
Code for the sells: double lots = PositionGetDouble(POSITION_VOLUME);
double openlvl = PositionGetDouble(POSITION_PRICE_OPEN);v::average_Sells = v::average_Sells + lots/v::total_lots*openlvl;
}
};Notice the script in the Sells column.. Average Buys, which should be average Sells


I get this error in the journal:
2025.01.28 14:17:37.430 2024.07.12 11:35:24 Error: Invalid TP requested (55749.77880 for Ask price 1.08857)
2025.01.28 14:17:37.430 2024.07.12 11:35:24 Error: Invalid TP requested (55749.77880 for Ask price 1.08857)This is my blocks for Buys:

This is my blocks for Sells:

So why would this happen? Is the another way to get a dynamic TP for group1 and 2 that will not interfere with each other?
It gets worse when you have more trades running
Help would be appreciated ... Thank you
-
Add a shared link to see what happening
-
@jstap, thanks for answering .. https://fxdreema.com/shared/wd3u7XTDc
Problem no1. The average buys and average sells get confused.
Problem no2. The average ranges and gets bigger the longer the expert run
Problem no3.. The correct writing in the right upper corner should read average Sells not average BuysIf you could help it will be much appreciated
-
Not sure what is creating any writing, strip this back and create smaller test projects, then what's wrong can be seen more easily, and by process of elimination, you remove anything that's causing the problems. You can then upload it so someone can help with 1 specific problem at a time.
-
Hmmm! Thank you. I have done that... canot see a problem except if there is some way the expert see both sells buys, but because of the groups distinguish I do not see the how.. anyway.. I also split the expert in a buy only and sell only
-
Add your link and I'll see if I can see the problem
-
@jstap check previous .. I already gave you the link.
-
No mate that is your full project, I am talking about a test project to check sections, limit this to 1 problem, then sort the next, and then add them together to complete your project.