Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

• ## Welcome Guests

Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

# AND OR Optimization in Amibroker

## Recommended Posts

Is it possible to use AND and OR for optimization in Amibroker? Lets look at this line of code:

U = Optimize(1, 0, 1, 1);

Buy = (C > MA(C,20) ) == U;  //condition is True if U = 1 and False if U = 0

In effect I can flip ">" operator to "<=" by using numerical values of 0 for False and 1 for True in optimization. Is there a way to do the same with AND and OR?

Lets look at this line of code:

Buy = ROC(C,5) > 1 OR ROC(C,1) < -2;

and this one:

Buy = ROC(C,5) > 1 AND ROC(C,1) < -2;

Is there a way to run an optimization on the following so it is an equivalent to switching between AND and OR:

OPERATOR = Optimize(AND, AND, OR, ?);

Buy = ROC(C,5) > 1 OPERATOR ROC(C,1) < -2;

Any help would be greatly appreciated.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

• 0
• 19
• 8
• 2
• 1
• ### Posts

• This should really be very easy, but I can't find an article or video to walk me through it. I picked 20 ticker symbols where the stocks are in a tight trading range. I got them all into one list I call "Channel". I'd like to add several indicators that apply to all, such as MACD, volume, 3 moving averages. Then I'd like to scroll through the list, adding trendlines, or horizontal lines to mark the top & bottom of the price channel for each. Then set an alarm for a breakout in each direction that indicates a breakout. Could you point me to an article or video that walks me through how to do this? ...or give me the steps? Thank you, RichardV2, Experienced stock trader back before the Internet was invented.😁
• GBPJPY Reverses Its Sell-Off Around the Level at 130.75  OCTOBER 9, 2019  Azeez Mustapha  No Comments   GBPJPY Price Analysis – October 9 In the prior session, the pair closed lower for the second day in a row, but currently, the GBPJPY displays a weakness further downside of the pair while retaining its wider medium-term outlook by temporal reversal on the level at 130.75.   Key Levels Resistance Levels: 148.66, 137.80, 135.774 Support Levels: 130.75, 128.68, 126.54   GBPJPY Long term Trend: Bearish In the bigger picture, the GBPJPY consolidation structure is still forming from the technical support zone on the level at 126.54 low.   A further upward move may be recorded towards the level at 146.57 and 148.66 in an extension where its resistance is glaring before completing the structure. However, the overall trend remains bearish while displaying an intact downtrend in the medium and long-term.   GBPJPY Short term Trend: Bearish On the 4-hour time frame, its price is trading narrowly between the moving average 5 and 13 close to the key technical support level at 130.44.   As it is presently, the intraday bias in GBPJPY remains on the downside at this point where a corrective rebound from the level at 126.54 low should have completed. Meanwhile, its 4-hour RSI is bearish and pointing lower suggesting further weakness.   Source: https://learn2.trade
×
×
• Create New...

## Important Information

By using this site, you agree to our Terms of Use.