Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- discounts are available after registering.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I am trying to build a daily profit stop for my trading system. The idea is to activate a trigger (or flag) that kicks in at a predetermined profit ($200 dollars for example) and keeps trading as long as the daily profit is above that profit level. As soon as the daily profit drops below it ($187.50 for example) the system stops trading for the day. I tried variations on the daily loss/profit examples in this forum, but it does not work correctly. Here is an example of what I have done so far:
If Use_ProfitStop = True then begin
If date > date[1] and time < StartTime then begin
yesterdayProfit = NetProfit;
end;
begin
todayProfit = NetProfit - yesterdayProfit;
end;
end;
If ProfitStop < (todayProfit + MaxPositionProfit) and (todayProfit + OpenPositionProfit) < ProfitStop
then StopTrading = True else StopTrading = False;
If MarketPosition = 1 and StopTrading = True then Sell("PStop_X_L")this bar close;
If MarketPosition = -1 and StopTrading = True then Buytocover("PStop_X_S")this bar close;
Problem is that I get the signal that it has reached a limit, but it re-enters the market again later on the same trading day. Any help is greatly appreciated!
Can you help answer these questions from other members on NexusFi?
The code that you combine with your question doesn't make sense since it doesn't show any entries.
So, by which magic do you think other NexusFi members could guess how your entry rules are faulty
because they lead to unwanted re-entries?
Think, you a) didn't get the answer or b) don't want to get it.
Let's suppose a), so the answer is:
Your code isn't "a variation", it doesn't contain any entries at all. I.e.: There are no longs that
could be sold nor shorts that could be covered. Nada.
In short:
Based on this code snippet there is nothing that could be corrected that is related to your problem.