Reply

how to handle unknown number of trades by their magic numbers

7 replies

Tarwada

Subscriber, bbp_participant, community, course_strategyquant-x-course, 92 replies.

Visit profile

7 years ago #116727

hello, i know the topic is a bit confusing but i will explain what im trying to say

 

let’s say that my strategy opens a buy order for every bullish candle.. ok ? (just an example)… now we don’t know how many trades will be opened during the day

 

to generate random magic numbers, i will set a variable to hold one magic number (say 10) , then after every opened order i must add “assign variable” and then i assign the variable of that magic number to + 1 (the variable that hold the magic number is now 11, now i can re enter without having conflict with magic number)

 

my question is : what if i want each order to have a custom trailing stop that moves the stop x amount of pips only if the open PL is >= x in pips

 

for example : if the market moved 50 pips, the stop will be break even… after that, if it moved 20 pips … nothing happens … if it moved 30 more pips (50 in total) the stop will lock 50 pips and so on …

 

the trailing stop only moves per 50 pips, there will be an input where i set the 50 pip lock or whatever i like

 

since my strategy has (reEntering) method , i don’t actually know how many trades will be executed so im confused about how can i set each trade trailing-stop with its random magic number created by the method i mentioned above

 

sorry for my english i hope you got what im talking about

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

7 years ago #142775

Ok, this might be possible to do. I will try to make an example for this and let you know

0

Tarwada

Subscriber, bbp_participant, community, course_strategyquant-x-course, 92 replies.

Visit profile

6 years ago #142788

Ok, this might be possible to do. I will try to make an example for this and let you know

thank you tomas, you answered like 120% of my questions here.

i really believe in you  ^_^

0

Tarwada

Subscriber, bbp_participant, community, course_strategyquant-x-course, 92 replies.

Visit profile

6 years ago #142824

@tomas262

have you made it  😀 ?

0

Tarwada

Subscriber, bbp_participant, community, course_strategyquant-x-course, 92 replies.

Visit profile

6 years ago #142837

hello 🙁

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

6 years ago #142845

Hello,

 

I tried to make this some way but realized if you want such advanced trailing stop for unknown number of trades it is not possible. You are not able to calculate all the trailing stops individually. This multi-step trailing stop is possible only for a single trade at time. It would have to be supported directly by MetaTrader

0

Tarwada

Subscriber, bbp_participant, community, course_strategyquant-x-course, 92 replies.

Visit profile

6 years ago #142866

ah … ok, what if i want to set a maximum number of 10 trades, how to do it ?

can you help me to do the example above ?

Hello,

 

I tried to make this some way but realized if you want such advanced trailing stop for unknown number of trades it is not possible. You are not able to calculate all the trailing stops individually. This multi-step trailing stop is possible only for a single trade at time. It would have to be supported directly by MetaTrader

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

6 years ago #142971

Hello,

 

this trailing can be realized only with a single trade basically or you can create variables for more trailing stops then a single one

0

Viewing 7 replies - 1 through 7 (of 7 total)