Topics
Replies
swingfish
18 Jul 2018, 15:09
RE:
Panagiotis Charalampous said:
Hi swingfish,
You can use something like this
foreach (var position in Positions) { if (position.SymbolCode == Symbol.Code) { ModifyPosition(position, null, null); } }Best Regards,
Panagiotis
hey, i tried that lready but could not get it to work ..
i have a init on the function start like this
var groups = Positions.GroupBy(x => x.SymbolCode).ToList(); foreach (var positions in groups) { .... all hedge code
and to execute the hedge (one side) its like this:
if (buyVolume > sellVolume) { // opens sell order equal to the difference of volumes ExecuteMarketOrder(TradeType.Sell, GetSymbol(symbolCode), buyVolume - sellVolume, "Hedge (NetLoss)"); Notifications.PlaySound(Flocation + "swingfish-helper-hedge.mp3"); foreach (var position in positions) { if (position.SymbolCode == Symbol.Code) { ModifyPosition(position, null, null); } } }
i noticed "Positions" is different, but i did try it with Positions and positions .. both have no effect. the order is placed, sound plays but no position is being edited ..
@swingfish
swingfish
18 Jun 2018, 22:18
never mind, i figured it out ;)
long VolumeBuy = Positions.Where(x => x.TradeType == TradeType.Buy && x.SymbolCode == Symbol.Code).Sum(x => x.Volume); long VolumeSell = Positions.Where(x => x.TradeType == TradeType.Sell && x.SymbolCode == Symbol.Code).Sum(x => -x.Volume); Print("Buy: " + VolumeBuy); Print("Sell: " + VolumeSell);
that works .. thanks for the help
@swingfish
swingfish
18 Jun 2018, 22:06
thanks alot .. but using just "positions" will count all positions, i need to filter them by Symbol
so i used
var symbolPositions = Positions.Where(t => t.SymbolCode == Symbol.Code);
to populate "symbolPositions"
@swingfish
swingfish
29 Mar 2018, 11:19
never mind about the fullscreen .. found it https://prnt.sc/ixwr2s just pressing F12 is faster anyway
@swingfish
swingfish
29 Mar 2018, 10:56
( Updated at: 21 Dec 2023, 09:20 )
RE:
Panagiotis Charalampous said:
Hi MaRCHeW,
Use the + button
Best Regards,
Panagiotis
the "+" is only visible in Single Chart mode .. extremely counter productive.
@swingfish
swingfish
13 Feb 2018, 18:15
yes it can! by simply run the loop twice.
first loop to count the volume (which the algo does already)
place the counter market order (which the algo does already)
and then take all the time in the world to loop again and remove the SL AND TP as time is not essential anymore (which the algo does NOT do currently)
my question was more related to how to do that at all "remove SL and TP" from orders
@swingfish
swingfish
08 Jan 2018, 10:19
RE:
Panagiotis Charalampous said:
If you post your custom indicator then maybe somebody from the community could suggest a solution to your problem.
i was under the impression that this here is "the community" ;)
@swingfish
swingfish
05 Jan 2018, 19:18
( Updated at: 21 Dec 2023, 09:20 )
i have a custom indicator. it does, however, reset to 0 at the beginning of the trading day.
but the previous session data is still there making the charts to look shrieked
simply removing the past before the reset would fix this problem permanently.
attached image has a 29pip range but it shows like 5 because of the past deviation
@swingfish
swingfish
12 Nov 2017, 10:07
great !
thanks .. but how do i know which one is the correct one .. besides of the file date ?
also do the paths change once there was a update ?
@swingfish
swingfish
22 Aug 2017, 05:34
RE:
Spotware said:
Let us know if the above helps or if you meant something different.
the idea is simple .. draw a Trendline on the chart .. and once the price reached or crossed the line .. Close the trade.
everything straight forward, exept that i could not figure out how i can get the price of a trendline at the current moment in order to compare it to the market-price
@swingfish
swingfish
22 Aug 2017, 05:30
hello .. and thanks for the repluy but no
i want to Draw a Tilted Line on a chart .. and have calgo find out the price of it in realtime as if the line is tilted the price will change based of the time.
the idea is to make a Algo that takes profit on a certain line.
@swingfish
swingfish
21 Jul 2017, 02:15
hello there and thank you
that did the job,
the aim is to get rid of the orders as fast as possible to maintain the target price .. waiting for sync does have advantages, but in this case its better to get the commands out fast ..
Async did the job, sure i still have the lag but all orders are sent already and the server has to deal with it .. thats a huge advantage.
thanks again
@swingfish
swingfish
20 Jul 2017, 20:00
nice and thanks alot
for now i just put the onTick in the timer loop .. making it run instantly .. well 100ms instant ;)
thanks alot.
protected override void OnTimer() { OnTick(); }
@swingfish
swingfish
13 Jul 2017, 00:47
never mind .. i figured it out .
double profit = target;
changed to
double profit = 0;
:)
@swingfish
swingfish
26 Jul 2016, 05:57
RE:
Spotware said:
Hello,
We get an idea of what you require. What we can recommend is adding this suggestion to our User Voice portal vote.spotware.com.
you are out of votes :(
i just found that someone else suggested this in february already .. thanks for the hint.
@swingfish
swingfish
18 Jul 2018, 15:24
oh never mind .. i figured it out
since i use a group there is no need to make the the filter for the selected symbol.
thanks for your help ;)
however do you have an idea on how i can get rid of the "nothing to change" error (happens if a position does not have TP or SL set
@swingfish