Help - I can't see the wood for the trees

Post Reply
User avatar
RisklessPips
Trader
Posts: 246
Joined: Mon May 09, 2016 2:24 pm
Location: Nairobi, Kenya

Help - I can't see the wood for the trees

Post by RisklessPips »

Code: Select all

if ((UseADX) && (!UseHGI))
{
   Alert("TRUE");
}
else
{
   Alert("FALSE");
}
This construct above is in GTWV’s breakeven processing.

A comment at the top of the function is
TradeComment = “”;
Ensuring this field is reset every pass thru.

The function then proceeds to populate the field with an appropriate comment based on signal service selected before modifying the trade AND opening a new one with this comment.

In this particular test I am doing ONLY HGI signals are switched on and the construct above gives a False alert when I test it. (As expected !)

Problem

The attached screen shot shows two comment outputs coming from processing in the True result block. The ones with ADX

I’m beating my head on the wall. How can this be ? :arrrg: :arrrg: :arrrg:

Charles
Comments.png
Edit - I was resetting the variable by TradeComment = “”; (no space between the quotes)
I have now changed it to TradeComment = “ ”; (A space in between the quotes) - is this relevant or is my brain in need of medication ?
You do not have the required permissions to view the files attached to this post.
Trading is a mind game - good job I have a brain
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Help - I can't see the wood for the trees

Post by SteveHopwood »

RisklessPips » Thu Oct 12, 2017 2:40 pm wrote: Edit - I was resetting the variable by TradeComment = “”; (no space between the quotes)
I have now changed it to TradeComment = “ ”; (A space in between the quotes) - is this relevant or is my brain in need of medication ?
Truth to tell Charles, I do not understand your post.

What I can say is this: trying to send a trade with a TradeComment of "" will generate an error - cannot remember which one. A TradeComment of " " will not.

Go to OnInit() of any EA that I have ever coded with TradeComment as an input and you will see this line of code:
if(TradeComment=="") TradeComment=" ";

Not sure if this helps you Charles - merely confirming the bit of your post that I quote.

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
RisklessPips
Trader
Posts: 246
Joined: Mon May 09, 2016 2:24 pm
Location: Nairobi, Kenya

Help - I can't see the wood for the trees

Post by RisklessPips »

SteveHopwood » Thu Oct 12, 2017 6:06 pm wrote:
Truth to tell Charles, I do not understand your post.

What I can say is this: trying to send a trade with a TradeComment of "" will generate an error - cannot remember which one. A TradeComment of " " will not.

Go to OnInit() of any EA that I have ever coded with TradeComment as an input and you will see this line of code:
if(TradeComment=="") TradeComment=" ";

Not sure if this helps you Charles - merely confirming the bit of your post that I quote.

:xm:
Thank you Steve.

You have confirmed a suspicion i had that the incorrect comment being added to trades was caused by that ""; ( no space) assignment.

Will keep monitoring it.

Charles
Trading is a mind game - good job I have a brain
Post Reply

Return to “Coders Hangout”