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)
Thanks, but something still not right. This is what I have. tgamt is trigger amount in ticks for when to start the trail stop.
slamt is the stop loss amount in ticks.
Both tgamt and slamt must be specified in DOLLARS, not BigPoints, not Ticks.
If you need to, convert your input in ticks to dollars:
So use this: tgamt_ticks * dollarspertick, slamt_ticks * dollarspertick
Ok, my mistake. tgamt and slamt are dollar amounts. Not ticks.
Regardless, that didn't solve it. I even changed the IF statement to check is Openpositionprofit is greater than 0, and it still returns false.
value7 just prints the value of Openpositionprofit on the chart just so that I can confirm it has a value, which it does. But for some reason, it returns false when tested to see if it is greater than 0.
Something is wrong with your signal's set-up and properties.
Try using PositionProfit(0) in place of OpenPositionProfit.
This code is within a SIGNAL, correct ?
Note: it won't work in an INDICATOR.
Something is wrong with your signal's set-up and properties.
Try using PositionProfit(0) in place of OpenPositionProfit.
This code is within a SIGNAL, correct ?
Note: it won't work in an INDICATOR.
It is in a strategy.
I'll try that and post back here.
Something is wrong with your signal's set-up and properties.
Try using PositionProfit(0) in place of OpenPositionProfit.
This code is within a SIGNAL, correct ?
Note: it won't work in an INDICATOR.
Ok, I see what the problem is, I just don't know how to fix it.
PositionProfit or openPositionProfit both show the profit at the close of the previous candle. But show 0 for the current candle. So 0 is never >= to tgamt, and therefore it doesn't trigger the trail stop.
Something is wrong with your signal's set-up and properties.
Try using PositionProfit(0) in place of OpenPositionProfit.
This code is within a SIGNAL, correct ?
Note: it won't work in an INDICATOR.
Ok, it is absolutely what I said. The trigger to start the the trail stop order isn't working, because it is looking at the close price of the previous bar and not the current price of the current candle.
Ok, it is absolutely what I said. The trigger to start the the trail stop order isn't working, because it is looking at the close price of the previous bar and not the current price of the current candle.
That is not the correct behavior as the Set statements should be active in the current bar. They are designed to operate INTRABAR and don't require [IntraBarOrderGeneration] to be on. It is independent of that condition.
The only thing I can think of is that the Set statement is not being called after the close of the last bar. It must be called in order to be active.
Please contact MC tech support with this problem and be ready to demonstrate this problem.