need advice from a trawl pro that controls two positions independently of each other, how can it be implemented? - page 4
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
on the 2sell the trawl should have put the SL at 850
i got it close at 950, not at manual trade
How can it be solved in the code?
Why would I do that? If the price has only reached 899, the trall should be 50 pips away, so somewhere around 950 it should be.
he closed it on SL from 1sell
does not anyone know
You probably want a trall for a position to be activated only when the price has moved to the right side by at least X pips from the open price of the position (e.g. 100)? If so, it is one line of code additionally in the trall function
Another variant is that a trall is triggered when X points have passed from the open price: go 100 points - trall -50 points, go another 100 points - trall again at -50, etc.
Perhaps you need the trawl for a position to be activated only when the price has moved in the required direction by at least X points from the open price of the position (e.g. 100)? If yes, then this is one line of code additionally in the trall function
There is also a variant that a trall will be triggered when X points pass from the opening price: pass 100p - trall -50p, pass another 100p - trall again at -50p, etc.
I have it like that, i.e. the trall is turned on at certain events
there are no problems when one position is opened,
if you open 2 or more positions, trawl exposes only one SL,
if any position reaches the SL
all positions of this type are closed
I need the trailers to hold positions of one type
independently
I have it that way, i.e. the trawl is switched on at certain events
when one position is open there is no problem,
if you open 2 or more positions, the trawl only sets one SL,
when any position reaches SL
all positions of this type are closed
You set the same stop loss for all positions at TralingStop points from the last price and move only in the direction of the open position. I.e. for all positions the buy trailing is set from the maximum for the holding period and of course they all close at the same time as the maximum will be common. Consider what you need, what is the algorithm that closes "positions of the same type independently of each other". There are a lot of variants.
In settings SL is not set i.e. =0, TP also =0,
Trawl=50 pips for all positions and all types
Trailing should lead positions independently of each other
at 1000=pos1Buy price went north at 1050 Trawl puts SL for pos1Buy
price went further north, reached 1090, SL for pos1Buy remained 1050, no SL for pos2Buy
Price went south, got to 1050, both positions are closed.
I need SL to close only pos1
pos2 should close on SL if the price reaches 1140 ,
I.e. at 1130 there is SL for pos2, and from 1140 the price falls below 1130
should trigger SL for pos2
поз2Buy--------------------------------------------------------------------------1080
SL---------------------------------------------------------------------------------1050
поз1Buy--------------------------------------------------------------------------1000
When you open an order you can set it to Time[0] or something else, date, time or whatever.)
takes:
level_ts - trailing stop in points
level_step - Trailing step
mn - Magik, if -1, it will trawl all orders.
In settings SL is not set i.e. =0, TP also =0,
Trawl=50 pips for all positions and all types
Trailing should lead positions independently of each other
at 1000=pos1Buy price went north at 1050 Trawl puts SL for pos1Buy
price went further north, reached 1090, SL for pos1Buy remained 1050, no SL for pos2Buy
Price went south, got to 1050, both positions are closed.
I need SL to close only pos1
pos2 should close on SL if the price reaches 1140 ,
I.e.at 1130 there is SL for pos2, and from 1140 the price falls below 1130
should trigger SL for pos2
поз2Buy--------------------------------------------------------------------------1080
SL---------------------------------------------------------------------------------1050
поз1Buy--------------------------------------------------------------------------1000
if I understand correctly, you need to replace
at
the same for sell.